public class AICharacterManager extends BasicCharacterManager implements com.sun.sgs.app.Task
| Modifier and Type | Method and Description |
|---|---|
void |
broadcastUpdates(Collection<BoardSpace> updates)
Sends space updates to this AI creature.
|
Character |
getCurrentCharacter()
Returns the current character being played through this manager.
|
static AICharacterManager |
newInstance()
Returns a reference to a new instance of
AICharacterManager
that is registered correctly. |
void |
notifyCharacterDied()
Notify the manager that its character has died.
|
void |
run()
Tells the AI creature that it's their turn to take some action.
|
void |
sendBoard(Board board)
Sends the given board to this AI creature.
|
void |
setCharacter(AICharacter character)
Sets the character for this manager.
|
equals, getCurrentLevel, getLevelXPos, getLevelYPos, hashCode, setCurrentLevel, setLevelPosition, toStringpublic static AICharacterManager newInstance()
AICharacterManager
that is registered correctly. After calling this you still need to
call setCharacter to give this manager a character.public Character getCurrentCharacter()
AICharacterManagers only have one character that they
manage, the current character is always the same.getCurrentCharacter in interface CharacterManagerpublic void setCharacter(AICharacter character)
character - the character to managepublic void run()
throws Exception
run in interface com.sun.sgs.app.TaskExceptionpublic void notifyCharacterDied()
public void sendBoard(Board board)
sendBoard in interface CharacterManagerboard - the board to sendpublic void broadcastUpdates(Collection<BoardSpace> updates)
broadcastUpdates in interface CharacterManagerupdates - the updates to sendCopyright © 2013. All Rights Reserved.