public abstract class Strategy extends Object implements Runnable, Observer
Modifier and Type | Field and Description |
---|---|
protected AIController |
controller
The AIController connected to this strategy
|
protected de.smarten.tsuro.shared.gamemodel.Placement |
firstPlacement
Deprecated.
Implement InitStrategy instead
The initial placement the strategy wants to use
|
protected de.smarten.tsuro.shared.gamemodel.GameModel |
gameModel
The GameModel this strategy observes
|
protected de.smarten.tsuro.shared.gamemodel.Token |
tokenStart
Deprecated.
Implement InitStrategy instead
The Position/Gate at which the strategy wants to put its token
|
Constructor and Description |
---|
Strategy(AIController controller,
de.smarten.tsuro.shared.gamemodel.GameModel gameModel)
The constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearResults()
Removes all tiles from the results stack
|
de.smarten.tsuro.shared.gamemodel.Placement |
getFirstPlacement()
Returns the first placement the strategy suggests.
|
de.smarten.tsuro.shared.gamemodel.Tile |
getResult()
Returns the result on top of the stack
|
de.smarten.tsuro.shared.gamemodel.Token |
getTokenStart()
Returns the token/gate the strategy wants to start at
|
protected void |
pushResult(de.smarten.tsuro.shared.gamemodel.Tile result)
Adds the specified Tile to the results stack
|
protected de.smarten.tsuro.shared.gamemodel.Placement firstPlacement
protected de.smarten.tsuro.shared.gamemodel.Token tokenStart
protected final de.smarten.tsuro.shared.gamemodel.GameModel gameModel
protected final AIController controller
public Strategy(AIController controller, de.smarten.tsuro.shared.gamemodel.GameModel gameModel)
controller
- the given AIControllergameModel
- the given GameModelpublic final de.smarten.tsuro.shared.gamemodel.Tile getResult()
public final de.smarten.tsuro.shared.gamemodel.Placement getFirstPlacement()
public final de.smarten.tsuro.shared.gamemodel.Token getTokenStart()
protected final void pushResult(de.smarten.tsuro.shared.gamemodel.Tile result)
result
- is the stack the specified Tile is added topublic void clearResults()
Copyright © 2017 smarTen. All rights reserved.