soc.game
Class SOCTradeOffer
java.lang.Object
soc.game.SOCTradeOffer
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SOCTradeOffer
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Cloneable
This class represents a trade offer in Settlers of Catan
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
game
java.lang.String game
give
SOCResourceSet give
get
SOCResourceSet get
from
int from
to
boolean[] to
SOCTradeOffer
public SOCTradeOffer(java.lang.String game,
int from,
boolean[] to,
SOCResourceSet give,
SOCResourceSet get)
- The constructor for a SOCTradeOffer
- Parameters:
game
- the name of the game in which this offer was madefrom
- the number of the player making the offerto
- a boolean array where 'true' means that the offer
is being made to the player with the same number as
the index of the 'true'give
- the set of resources being givenget
- the set of resources being asked for
SOCTradeOffer
public SOCTradeOffer(SOCTradeOffer offer)
- make a copy of this offer
- Parameters:
offer
- the trade offer to copy
getGame
public java.lang.String getGame()
- Returns:
- the name of the game
getFrom
public int getFrom()
- Returns:
- the number of the player that made the offer
getTo
public boolean[] getTo()
- Returns:
- the boolean array representing to whom this offer was made
getGiveSet
public SOCResourceSet getGiveSet()
- Returns:
- the set of resources offered
getGetSet
public SOCResourceSet getGetSet()
- Returns:
- the set of resources wanted in exchange
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- a human readable string of data