mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Tobias og Gabriel lagde en robot class
This commit is contained in:
parent
fd6ae823c5
commit
ac43b7e322
@ -0,0 +1,41 @@
|
|||||||
|
package inf112.fiasko.roborally.element_properties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this class represtents a robot
|
||||||
|
*/
|
||||||
|
public class Robot {
|
||||||
|
private int robotDamageTaken = 0;
|
||||||
|
private int playerId; //might not be needed
|
||||||
|
private boolean inPowerDown = false;
|
||||||
|
private int lastFlagVisited = 0;
|
||||||
|
private Position backupPosition;
|
||||||
|
private Position currentPosition;
|
||||||
|
|
||||||
|
|
||||||
|
public Robot (int playerId, Position spawnPosition){
|
||||||
|
this.playerId=playerId;
|
||||||
|
this.backupPosition = spawnPosition;
|
||||||
|
this.currentPosition = spawnPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getDamage(){
|
||||||
|
return robotDamageTaken;
|
||||||
|
}
|
||||||
|
public void setDamage (int damage){
|
||||||
|
this.robotDamageTaken = damage;
|
||||||
|
}
|
||||||
|
public Position getPosition(){
|
||||||
|
return currentPosition;
|
||||||
|
}
|
||||||
|
public void setPosition( Position newPosition ){
|
||||||
|
this.currentPosition = newPosition;
|
||||||
|
}
|
||||||
|
public void setPowerDown(Boolean powerDownStatus){
|
||||||
|
this.inPowerDown = powerDownStatus;
|
||||||
|
}
|
||||||
|
public Boolean isInPowerDown(){
|
||||||
|
return inPowerDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user