added init for mdga with all states and messages
This commit is contained in:
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Piece.java
Normal file
37
Projekte/mdga/model/src/main/java/pp.mdga/game/Piece.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package pp.mdga.game;
|
||||
|
||||
public class Piece {
|
||||
private ShieldState shield;
|
||||
private PieceState state;
|
||||
private Color color;
|
||||
|
||||
public Piece(Color color, PieceState state) {
|
||||
this.color = color;
|
||||
this.state = state;
|
||||
shield = ShieldState.NONE;
|
||||
}
|
||||
|
||||
public void setShield(ShieldState shield) {
|
||||
this.shield = shield;
|
||||
}
|
||||
|
||||
public ShieldState getShield() {
|
||||
return shield;
|
||||
}
|
||||
|
||||
public void setState(PieceState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public PieceState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public boolean isShielded() {
|
||||
return shield == ShieldState.ACTIVE;
|
||||
}
|
||||
|
||||
public boolean isSuppressed() {
|
||||
return shield == ShieldState.SUPPRESSED;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user