Skip to content

DeveloplemtCards.java Line: 65 #82

@dborg291

Description

@dborg291
/**
 * @return the random dev card the player drew
 */
public DevelopmentCard getRandomCard() {
    Random random = new Random();
    int randomDevCard = random.nextInt(developmentCards.size() - 1);
    int drawnDevCard = developmentCards.get(randomDevCard);
    developmentCards.remove(randomDevCard);
    switch (drawnDevCard) { // switch to create new dev card
        case 0:
            return new Knight();
        case 1:
            return new VictoryPoints();
        case 2:
            return new RoadDevCard();
        case 3:
            return new Monopoly();
        case 4:
            return new YearOfPlenty();
        default:
            return null;
    }
}

Error: A new dev card just to make a new dev card of Knight, VicotryPoints, ReadDevcard, Monopoly, oe YearOfPlenty.
-db

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions