agentland.games.XiangQi
Class XiangQiAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.games.XiangQi.XiangQiAgent
- All Implemented Interfaces:
- Agent, MetagluePrimitives, Remote, Serializable, XiangQi, xiangQi.XQInput
- public class XiangQiAgent
- extends AgentAgent
- implements XiangQi, xiangQi.XQInput
The agent to control XiangQi (Chinese Chess) game
- See Also:
- Serialized Form
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, log, lookupClass, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOn, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou |
XiangQiAgent
public XiangQiAgent()
throws RemoteException
makeMove
public boolean makeMove(String start,
String destination)
throws RemoteException
- Call this to make the move
- Specified by:
makeMove
in interface XiangQi
- Parameters:
start
- position of the piece you want to movedestination
- position where you want the piece to move to- Returns:
- true if move was succesful, false if there was a
problem
isOver
public boolean isOver()
throws RemoteException
- Specified by:
isOver
in interface XiangQi
getWinner
public String getWinner()
throws RemoteException
- Specified by:
getWinner
in interface XiangQi
resetGame
public void resetGame()
throws RemoteException
- Specified by:
resetGame
in interface XiangQi
addPlayer
public void addPlayer(xiangQi.XQPlayer p)
- Specified by:
addPlayer
in interface xiangQi.XQInput
removePlayer
public void removePlayer(xiangQi.XQPlayer p)
- Specified by:
removePlayer
in interface xiangQi.XQInput