mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-09 03:29:35 +01:00
Fikser kommentarer, mellomrom og variabelnavn i Tile og Wall Flytter IGrid, Robot og Wall til objects Flytter tester til korresponderende pakker
44 lines
1.1 KiB
Java
44 lines
1.1 KiB
Java
package inf112.fiasko.roborally.objects;
|
|
|
|
import inf112.fiasko.roborally.element_properties.Position;
|
|
|
|
/**
|
|
* this class represents 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;
|
|
}
|
|
|
|
}
|