public class Token extends GameModelObservable implements IToken
Constructor and Description |
---|
Token()
This constructor creates a token with both position and gate being set to null.
|
Token(Gate gate,
Position position)
This constructor creates a token.
|
Token(Gate gate,
Position position,
GameModel gameModel)
Deprecated.
The GameModel will be set by the GameModel itself, please don't pass a GameModel here.
This constructor creates a token. When creating a player, the Player constructor
binds the token to the Player by calling the
setPlayer method. |
Modifier and Type | Method and Description |
---|---|
Gate |
getGate() |
Player |
getPlayer() |
Position |
getPosition() |
void |
setGate(Gate gate) |
void |
setPosition(Position position) |
addGameModelObservable, getGameModel, notifyGameModel, notifyGameModel, removeGameModelObservable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public Token()
setPlayer
method.public Token(Gate gate, Position position)
setPlayer
method.gate
- the gate the token is placed on a positionposition
- the position the token is placedpublic Token(Gate gate, Position position, GameModel gameModel)
setPlayer
method.gate
- the gate the token is placed on a positionposition
- the position the token is placedgameModel
- the GameModel that is notified if this token changespublic Player getPlayer()
public Position getPosition()
getPosition
in interface IToken
public void setPosition(Position position)
setPosition
in interface IToken
Copyright © 2017 smarTen. All rights reserved.