added init for mdga with all states and messages

This commit is contained in:
Cedric Beck
2024-11-12 17:26:10 +01:00
parent ef16a3f92b
commit a684405891
238 changed files with 1596 additions and 44560 deletions

View File

@@ -0,0 +1,47 @@
package pp.mdga.game;
/**
* This class will be used the represent a Node on which the pieces can travel along
*/
public class Node {
protected Piece occupant;
public Node() {}
/**
* This method is used to get an occupant of the Node.
*
* @return the current occupant of the node
*/
public Piece getOccupant() {
return occupant;
}
/**
* This method is used to set a new Occupant
*
* @param occupant the new occupant of the node
*/
public void setOccupant(Piece occupant) {
if (occupant.isSuppressed()){
occupant.setShield(ShieldState.NONE);
}
this.occupant = occupant;
}
/**
* This method is used to clear the node of its occupant
*/
public void clearOccupant() {
this.occupant = null;
}
/**
* This method is used to return a boolean value based on the occupation status
*
* @return the boolean value corresponding to the occupation status
*/
public boolean isOccupied() {
return occupant != null;
}
}