2007-03-29 23:21:00 +00:00
|
|
|
package ei.game.scene;
|
|
|
|
|
|
2007-04-16 11:34:57 +00:00
|
|
|
import ei.engine.scene.Entity;
|
|
|
|
|
|
2007-03-29 23:21:00 +00:00
|
|
|
public abstract class GameEntity{
|
|
|
|
|
private int life;
|
2007-04-16 11:34:57 +00:00
|
|
|
private boolean selected;
|
2007-03-29 23:21:00 +00:00
|
|
|
|
|
|
|
|
public GameEntity(int l){
|
|
|
|
|
life = l;
|
2007-04-16 11:34:57 +00:00
|
|
|
this.selected = false;
|
2007-03-29 23:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the life
|
|
|
|
|
*
|
|
|
|
|
* @return The life
|
|
|
|
|
*/
|
|
|
|
|
public int getLife(){
|
|
|
|
|
return life;
|
|
|
|
|
}
|
2007-04-16 11:34:57 +00:00
|
|
|
/**
|
|
|
|
|
* If the unit is selected.
|
|
|
|
|
* @return true if selected.
|
|
|
|
|
*/
|
|
|
|
|
public boolean isSelected() {
|
|
|
|
|
return selected;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Sets a unit to be selected or not.
|
|
|
|
|
* @param b true or false.
|
|
|
|
|
*/
|
|
|
|
|
public void setSelected(boolean b) {
|
|
|
|
|
this.selected = b;
|
|
|
|
|
}
|
|
|
|
|
protected abstract Entity getSelection();
|
2007-03-29 23:21:00 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the life
|
|
|
|
|
* @param l The life to set to
|
|
|
|
|
*/
|
|
|
|
|
public void setLife(int l){
|
|
|
|
|
life = l;
|
|
|
|
|
}
|
2007-04-04 18:07:00 +00:00
|
|
|
public void move(int x, int y) {
|
2007-04-04 18:05:11 +00:00
|
|
|
|
|
|
|
|
}
|
2007-04-05 12:45:22 +00:00
|
|
|
|
|
|
|
|
public abstract void update();
|
2007-03-29 23:21:00 +00:00
|
|
|
}
|