2020-02-20 13:12:18 +01:00
|
|
|
package inf112.fiasko.roborally.objects;
|
|
|
|
|
|
|
|
import inf112.fiasko.roborally.element_properties.Position;
|
2020-02-20 11:56:20 +01:00
|
|
|
|
|
|
|
/**
|
2020-02-20 13:12:18 +01:00
|
|
|
* this class represents a robot
|
2020-02-20 11:56:20 +01:00
|
|
|
*/
|
|
|
|
public class Robot {
|
|
|
|
private int robotDamageTaken = 0;
|
2020-02-20 14:10:56 +01:00
|
|
|
private final int playerId; //might not be needed
|
2020-02-20 11:56:20 +01:00
|
|
|
private boolean inPowerDown = false;
|
|
|
|
private int lastFlagVisited = 0;
|
|
|
|
private Position backupPosition;
|
|
|
|
private Position currentPosition;
|
2020-02-20 12:05:49 +01:00
|
|
|
|
2020-02-22 13:18:30 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param playerId gives the robot a identifier that links it too the correct player
|
|
|
|
* @param spawnPosition
|
|
|
|
*/
|
2020-02-20 11:56:20 +01:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|