public class GoodsForSaleMessage extends DOMMessage
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Goods> |
sellGoods
The list of goods for sale.
|
private java.lang.String |
settlementId
The identifier of the settlement that is trading.
|
private java.lang.String |
unitId
The identifier of the unit that is trading.
|
document, logger| Constructor and Description |
|---|
GoodsForSaleMessage(Game game,
org.w3c.dom.Element element)
Create a new
GoodsForSaleMessage from a
supplied element. |
GoodsForSaleMessage(Unit unit,
Settlement settlement,
java.util.List<Goods> sellGoods)
Create a new
GoodsForSaleMessage with the
supplied name. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Goods> |
getGoods() |
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 "goodsForSale"-message.
|
org.w3c.dom.Element |
toXMLElement()
Convert this GoodsForSaleMessage to XML.
|
clientError, collapseElements, createError, createError, createMessage, createMessage, createNewDocument, createNewRootElement, elementToString, getAttribute, getChildElement, getDocument, getFreeColProtocolVersion, getType, hasAttribute, insertAsRoot, isType, setAttribute, setAttribute, toStringprivate final java.lang.String unitId
private final java.lang.String settlementId
private final java.util.List<Goods> sellGoods
public GoodsForSaleMessage(Unit unit, Settlement settlement, java.util.List<Goods> sellGoods)
GoodsForSaleMessage with the
supplied name.unit - The Unit that is trading.settlement - The Settlement that is trading.sellGoods - A list of Goods to be sold.public GoodsForSaleMessage(Game game, org.w3c.dom.Element element)
GoodsForSaleMessage from a
supplied element.game - The Game this message belongs to.element - The Element to use to create the message.public java.util.List<Goods> getGoods()
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.GoodsForSaleMessage with the goods
for sale attached as children or an error
Element on failure.public org.w3c.dom.Element toXMLElement()
toXMLElement in class DOMMessagepublic static java.lang.String getXMLElementTagName()