Files
Gruppe-01-fin/Projekte/mdga/model/src/main/java/pp.mdga/game/Board.java

51 lines
1.2 KiB
Java

package pp.mdga.game;
import java.util.Map;
/**
* This class will be used to hold all Board relevant data.
*/
public class Board {
private Map<Color, PlayerData> playerData;
private Node[] infield;
/**
* This constructor is used to create a new board
*/
public Board() {
infield = new Node[40];
for (int i = 0; i < 40; i++) {
if (i % 10 == 0) {
infield[i] = new StartNode(
i == 0 ? Color.ARMY :
i == 10 ? Color.AIRFORCE :
i == 20 ? Color.CYBER :
Color.NAVY
);
} else if (i == 4 || i == 14 || i == 24 || i == 34) {
infield[i] = new BonusNode();
} else {
infield[i] = new Node();
}
}
}
/**
* This method returns the playerData
*
* @return the playerData
*/
public Map<Color, PlayerData> getPlayerData() {
return playerData;
}
/**
* This method returns the infield
*
* @return the infield
*/
public Node[] getInfield() {
return infield;
}
}