added init for mdga with all states and messages
This commit is contained in:
45
Projekte/mdga/model/src/main/java/pp.mdga/game/Board.java
Normal file
45
Projekte/mdga/model/src/main/java/pp.mdga/game/Board.java
Normal file
@@ -0,0 +1,45 @@
|
||||
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, Player> 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();
|
||||
} 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, Player> getPlayerData() {
|
||||
return playerData;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the infield
|
||||
*
|
||||
* @return the infield
|
||||
*/
|
||||
public Node[] getInfield() {
|
||||
return infield;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user