org.vizzini.ui.game.boardgame
Class TextAgent
java.lang.Object
org.vizzini.game.AbstractAgent
org.vizzini.game.AbstractHumanAgent
org.vizzini.ui.game.boardgame.TextAgent
- All Implemented Interfaces:
- Serializable, IAgent, IHumanAgent
- Direct Known Subclasses:
- MovementTextAgent, PlacementTextAgent
public abstract class TextAgent
- extends AbstractHumanAgent
Provides a user interface for a human agent which uses the text input to
place a token.
- Since:
- v0.1
- Version:
- v0.2
- Author:
- Jeffrey M. Thompson
- See Also:
- Serialized Form
Method Summary |
protected String |
getPrompt()
Return the prompt string. |
protected List |
parseInput(String line)
Return the position obtained by parsing the given string. |
protected String |
readInput()
Read string input from standard in until a carriage return is read. |
Methods inherited from class org.vizzini.game.AbstractAgent |
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, configure, equals, getConcedeManager, getIndex, getName, getProperties, getPropertyChangeManager, getScore, getScoreManager, getTeam, getTokenCollection, getTokenCollectionClass, hashCode, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam, setTokenCollectionClass, toString |
Methods inherited from interface org.vizzini.game.IAgent |
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, configure, getAction, getName, getScore, getTeam, getTokenCollection, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam |
TextAgent
public TextAgent()
getPrompt
protected String getPrompt()
- Return the prompt string.
- Since:
- v0.1
parseInput
protected List parseInput(String line)
- Return the position obtained by parsing the given string.
- Parameters:
line
- The string to parse for position information.
- Returns:
- Array which contains input coordinates.
- Since:
- v0.1
readInput
protected String readInput()
- Read string input from standard in until a carriage return is read.
- Since:
- v0.1
Copyright © 2007 Vizzini.org. All Rights Reserved.
|
2007.12.25.03.00.02 |