Commits

Nikolaos Margaris  committed 6965899

... added a minor pawnQueue logic

  • Participants
  • Parent commits 271638c

Comments (0)

Files changed (4)

File src/com/nima/Game.java

 package com.nima;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
-import java.util.Queue;
 
 public class Game {
 	
 	/*
 	 * Must:
 	 * 		keep game's current status
+	 * 		keep track of active pawn
+	 * 		keep track of who's is active pawn
 	 */
 	
 	private List<Player> players = new ArrayList<Player>();
 	}
 	
 	public Pawn getCurrentPawn(){
-		return players.get(currentPlayerIndex).getActivePawn();
+		return pawnQueue.get(0);
 	}
 	
 	public void end(){
 		return board.export();
 	}
 	
-	public void rollTurns(){		
+	List<Pawn> pawnQueue = new ArrayList<Pawn>();
+	public void rollTurns(){
+		pawnQueue.clear();
+		for(int i = 0; i < numberOfPlayers; i++){						
+			pawnQueue.addAll(players.get(i).getAllPawns());
+		}
+		Collections.shuffle(pawnQueue);		
 	}
 	
 	public void showMoveMap(){		

File src/com/nima/HumanPlayer.java

 			this.activePawn = 0;
 		}
 	}
+	
+	public List<? extends Hero> getAllPawns(){
+		return heroesOwned;
+	}
 }

File src/com/nima/Player.java

 package com.nima;
 
+import java.util.List;
+
 public abstract class Player {
 	public static final String XARGON = "Xargon";
 	public enum Action {
 	 */
 	public abstract Pawn getActivePawn();
 	public abstract void activateNextPawn();
+	public abstract List<? extends Pawn> getAllPawns();
 }

File src/com/nima/Xargon.java

 	public void activateNextPawn(){
 		
 	}
+	
+	public List<? extends Pawn> getAllPawns(){
+		return monsters;
+	}
 }