|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.server.ai.AIInGameInputHandler
public final class AIInGameInputHandler
Handles the network messages that arrives while in the game.
| Field Summary | |
|---|---|
private AIMain |
aiMain
|
private FreeColServer |
freeColServer
The server. |
private static java.util.logging.Logger |
logger
|
private ServerPlayer |
serverPlayer
The player for whom I work. |
| Constructor Summary | |
|---|---|
AIInGameInputHandler(FreeColServer freeColServer,
ServerPlayer me,
AIMain aiMain)
The constructor to use. |
|
| Method Summary | |
|---|---|
boolean |
accepts(java.lang.String tagName)
Checks if the message handler support the given message. |
private org.w3c.dom.Element |
chooseFoundingFather(DummyConnection connection,
org.w3c.dom.Element element)
Handles a "chooseFoundingFather"-message. |
private org.w3c.dom.Element |
diplomaticTrade(DummyConnection connection,
org.w3c.dom.Element element)
Handles an "diplomaticTrade"-message. |
private org.w3c.dom.Element |
fountainOfYouth(DummyConnection connection,
org.w3c.dom.Element element)
Replies to fountain of youth offer. |
private AIPlayer |
getAIPlayer()
Gets the AIPlayer using this
AIInGameInputHandler. |
private AIUnit |
getAIUnit(Unit unit)
Gets the AI unit corresponding to a given unit, if any. |
org.w3c.dom.Element |
handle(Connection connection,
org.w3c.dom.Element element)
Deals with incoming messages that have just been received. |
void |
handle(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
Handles the main element of an XML message. |
private org.w3c.dom.Element |
indianDemand(DummyConnection connection,
org.w3c.dom.Element element)
Handles an "indianDemand"-message. |
private org.w3c.dom.Element |
lootCargo(Connection connection,
org.w3c.dom.Element element)
Replies to loot cargo offer. |
private org.w3c.dom.Element |
monarchAction(DummyConnection connection,
org.w3c.dom.Element element)
Handles a "monarchAction"-message. |
org.w3c.dom.Element |
multiple(Connection connection,
org.w3c.dom.Element element)
Handle all the children of this element. |
private org.w3c.dom.Element |
newLandName(DummyConnection connection,
org.w3c.dom.Element element)
Replies to offer to name the new land. |
private org.w3c.dom.Element |
newRegionName(DummyConnection connection,
org.w3c.dom.Element element)
Replies to offer to name a new region name. |
private org.w3c.dom.Element |
setCurrentPlayer(DummyConnection connection,
org.w3c.dom.Element setCurrentPlayerElement)
Handles a "setCurrentPlayer"-message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private final ServerPlayer serverPlayer
private final FreeColServer freeColServer
private final AIMain aiMain
| Constructor Detail |
|---|
public AIInGameInputHandler(FreeColServer freeColServer,
ServerPlayer me,
AIMain aiMain)
freeColServer - The main server.me - The AI player that is being managed by this
AIInGameInputHandler.aiMain - The main AI-object.| Method Detail |
|---|
public org.w3c.dom.Element handle(Connection connection,
org.w3c.dom.Element element)
handle in interface MessageHandlerconnection - The Connection the message was received
on.element - The root element of the message.
private AIPlayer getAIPlayer()
AIPlayer using this
AIInGameInputHandler.
AIPlayer.private AIUnit getAIUnit(Unit unit)
unit - The Unit to look up.
public void handle(Connection connection,
javax.xml.stream.XMLStreamReader in,
javax.xml.stream.XMLStreamWriter out)
handle in interface StreamedMessageHandlerconnection - The connection the message came from.in - The stream containing the message.out - The output stream for the reply.public boolean accepts(java.lang.String tagName)
accepts in interface StreamedMessageHandlertagName - The tag name of the message to check.
private org.w3c.dom.Element setCurrentPlayer(DummyConnection connection,
org.w3c.dom.Element setCurrentPlayerElement)
connection - The connection the message was received on.setCurrentPlayerElement - The element (root element in a DOM-parsed
XML tree) that holds all the information.
private org.w3c.dom.Element chooseFoundingFather(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connectio the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element monarchAction(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element indianDemand(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element diplomaticTrade(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element newLandName(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element newRegionName(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element fountainOfYouth(DummyConnection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
private org.w3c.dom.Element lootCargo(Connection connection,
org.w3c.dom.Element element)
connection - The connection the message was received on.element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
public org.w3c.dom.Element multiple(Connection connection,
org.w3c.dom.Element element)
element - The element (root element in a DOM-parsed XML tree) that
holds all the information.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||