|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractAgent
org.vizzini.game.AbstractHumanAgent
org.vizzini.example.gin.ui.TextHumanAgent
public class TextHumanAgent
Provides a user interface for a human agent which uses the text input to play Gin.
| Field Summary |
|---|
| Fields inherited from interface org.vizzini.game.IAgent |
|---|
NAME_PROPERTY, TEAM_PROPERTY |
| Constructor Summary | |
|---|---|
TextHumanAgent()
|
|
| Method Summary | |
|---|---|
IAction |
getAction(IEnvironment environment,
IAdjudicator adjudicator)
Return the action determined through consideration of the given environment and the given adjudicator. |
IAction |
getDiscardAction(IEnvironment environment,
IAdjudicator adjudicator)
Return the action determined through consideration of the given environment and the given adjudicator. |
protected String |
getDiscardPrompt()
Return the discard prompt string. |
IAction |
getDrawAction(IEnvironment environment,
IAdjudicator adjudicator)
Return the action determined through consideration of the given environment and the given adjudicator. |
protected String |
getName(String shortName)
Return the name for the given card display name. |
protected String |
getPrompt()
Return the prompt string. |
protected ISuit |
getSuit(char shortName)
Return the suit for the given suit display name. |
IAction |
getTakeDiscardAction(IEnvironment environment,
IAdjudicator adjudicator)
Return the action determined through consideration of the given environment and the given adjudicator. |
protected ICard |
parseDiscardInput(String line)
Return the position obtained by parsing the given string. |
protected char |
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.AbstractHumanAgent |
|---|
beep |
| 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 class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.vizzini.game.IAgent |
|---|
addConcedeListener, addPropertyChangeListener, addScoreListener, addToScore, concede, configure, getName, getScore, getTeam, getTokenCollection, incrementScore, removeConcedeListener, removePropertyChangeListener, removeScoreListener, reset, setName, setScore, setTeam |
| Constructor Detail |
|---|
public TextHumanAgent()
| Method Detail |
|---|
public IAction getAction(IEnvironment environment,
IAdjudicator adjudicator)
environment - The current environment.adjudicator - The adjudicator.
public IAction getDiscardAction(IEnvironment environment,
IAdjudicator adjudicator)
environment - The current environment.adjudicator - The adjudicator.
public IAction getDrawAction(IEnvironment environment,
IAdjudicator adjudicator)
environment - The current environment.adjudicator - The adjudicator.
public IAction getTakeDiscardAction(IEnvironment environment,
IAdjudicator adjudicator)
environment - The current environment.adjudicator - The adjudicator.protected String getDiscardPrompt()
protected String getName(String shortName)
protected String getPrompt()
protected ISuit getSuit(char shortName)
protected ICard parseDiscardInput(String line)
line - The string to parse for position information.
protected char parseInput(String line)
line - The string to parse for position information.
protected String readInput()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |