OrderLogicCard complete implementation
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public abstract class OrderLogicCard {
|
||||
private Queue<Player> players;
|
||||
public OrderLogicCard(ArrayList<Player> players) {
|
||||
Collections.shuffle(players);
|
||||
this.players = new LinkedList<>(players);
|
||||
}
|
||||
public void push(Player player){
|
||||
players.add(player);
|
||||
}
|
||||
public Player pull(Player player){
|
||||
return players.remove();
|
||||
}
|
||||
protected abstract void effect(Player player, int index) throws IndexOutOfBoundsException;
|
||||
}
|
||||
Reference in New Issue
Block a user