public final class AIController extends Object implements Observer
Strategy
-Instances do not send their results, but rather notify the AIController that they're finished.
The AIController will then fetch the Strategy's result.
The AIController will also fetch the Strategy's result if the timer has run out of time.
The AIController is supposed to be created upon starting a game.
The AIController is supposed to be destroyed once a game endedConstructor and Description |
---|
AIController(AIConnectionHandler callbackHandler,
AIConfig config,
de.smarten.tsuro.shared.gamemodel.GameModel gameModel) |
Modifier and Type | Method and Description |
---|---|
int |
getClientId() |
void |
startStopWatch()
(Re)starts the StopWatch
|
void |
startTurn(int activePlayerId,
boolean isTokenTurn)
checks if this client is the active Player and starts its own StopWatch accordingly
|
void |
StrategyFinishedCallback(Strategy caller)
Instructs the AIController to fetch the Strategy's result.
|
void |
update(Observable arg0,
Object arg1) |
public AIController(AIConnectionHandler callbackHandler, AIConfig config, de.smarten.tsuro.shared.gamemodel.GameModel gameModel)
public int getClientId()
public void startTurn(int activePlayerId, boolean isTokenTurn)
activePlayerId
- the ID of the active playerisTokenTurn
- proofs that the token is turnedpublic void startStopWatch()
public void StrategyFinishedCallback(Strategy caller)
caller
- the strategy the callback is going topublic void update(Observable arg0, Object arg1)
Copyright © 2017 smarTen. All rights reserved.