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

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
XiangQiAgent()
           
 
Method Summary
 void addPlayer(xiangQi.XQPlayer p)
           
 String getWinner()
           
 boolean isOver()
           
 boolean makeMove(String start, String destination)
          Call this to make the move
 void removePlayer(xiangQi.XQPlayer p)
           
 void resetGame()
           
 
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
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 

Constructor Detail

XiangQiAgent

public XiangQiAgent()
             throws RemoteException
Method Detail

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 move
destination - 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