public class BuyGoodsMessage extends DOMMessage
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
amountString
The amount of goods to buy.
|
private java.lang.String |
carrierId
The identifier of the carrier to load to goods onto.
|
private java.lang.String |
goodsTypeId
The identifier of the type of goods to buy.
|
document, logger| Constructor and Description |
|---|
BuyGoodsMessage(Game game,
org.w3c.dom.Element element)
Create a new
BuyGoodsMessage from a
supplied element. |
BuyGoodsMessage(Unit carrier,
GoodsType type,
int amount)
Create a new
BuyGoodsMessage. |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getXMLElementTagName()
The tag name of the root element representing this object.
|
org.w3c.dom.Element |
handle(FreeColServer server,
Player player,
Connection connection)
Handle a "buyGoods"-message.
|
org.w3c.dom.Element |
toXMLElement()
Convert this BuyGoodsMessage to XML.
|
clientError, collapseElements, createError, createError, createMessage, createMessage, createNewDocument, createNewRootElement, elementToString, getAttribute, getChildElement, getDocument, getFreeColProtocolVersion, getType, hasAttribute, insertAsRoot, isType, setAttribute, setAttribute, toStringprivate java.lang.String carrierId
private java.lang.String goodsTypeId
private java.lang.String amountString
public BuyGoodsMessage(Unit carrier, GoodsType type, int amount)
BuyGoodsMessage.carrier - The Unit to load the goods onto.type - The type of goods to buy.amount - The amount of goods to buy.public BuyGoodsMessage(Game game, org.w3c.dom.Element element)
BuyGoodsMessage from a
supplied element.game - The Game this message belongs to.element - The Element to use to create the message.public org.w3c.dom.Element handle(FreeColServer server, Player player, Connection connection)
server - The FreeColServer handling the message.player - The Player the message applies to.connection - The Connection message was received on.Element on failure.public org.w3c.dom.Element toXMLElement()
toXMLElement in class DOMMessagepublic static java.lang.String getXMLElementTagName()