|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.strategy.AbstractPlayer
public abstract class AbstractPlayer
This class represents the player, with its data, using a unique ID. The ID will be assigned to any entry owned by the player. Then it is possible to know which entry is owned by a player. It is also recommended to define ressources here (gold, wood...) using Ressource class.
Ressource
Field Summary | |
---|---|
int |
id
Player id. |
Constructor Summary | |
---|---|
AbstractPlayer(java.lang.String name)
Create a new player. |
Method Summary | |
---|---|
static AbstractPlayer |
get(int id)
Get a player from its id. |
java.lang.String |
getName()
Get player name. |
abstract void |
render(java.awt.Graphics2D g)
Render player routine. |
abstract void |
update(float extrp)
Update player routine. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int id
Constructor Detail |
---|
public AbstractPlayer(java.lang.String name)
name
- player name.Method Detail |
---|
public static AbstractPlayer get(int id)
id
- player id.
public abstract void update(float extrp)
extrp
- extrapolation value.public abstract void render(java.awt.Graphics2D g)
g
- graphic output.public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |