OrderLogicCard complete implementation

This commit is contained in:
rubenpirreram
2026-03-15 22:37:54 +01:00
parent 020ba874de
commit ec4c85af79
5 changed files with 151 additions and 0 deletions
@@ -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;
}