-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstBot.java
More file actions
26 lines (21 loc) · 856 Bytes
/
FirstBot.java
File metadata and controls
26 lines (21 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import java.util.ArrayList;
import java.util.List;
public class FirstBot extends Bot {
//Important: you are able to change the variable "waitingTime" in Game.java, so everything can get slower
List<Card> opponentCards = new ArrayList<>();
Card placedCard;
public FirstBot(int cardAmount) {
super(cardAmount, "FirstBot");
}
public void placeCard(List<Card> opponentCards, Card placedCard) {
this.placedCard = placedCard;
this.opponentCards = opponentCards;
for (int i = 0; i < cards.size(); i++) {
Card currentCard = cards.get(i);
if (currentCard.getValue() == placedCard.getValue() || currentCard.getColor() == placedCard.getColor()) {
this.placeCard(i);
return;
}
}
}
}