soc.game
Class SOCTradeOffer

java.lang.Object
  extended by 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

Field Summary
(package private)  int from
           
(package private)  java.lang.String game
           
(package private)  SOCResourceSet get
           
(package private)  SOCResourceSet give
           
(package private)  boolean[] to
           
 
Constructor Summary
SOCTradeOffer(SOCTradeOffer offer)
          make a copy of this offer
SOCTradeOffer(java.lang.String game, int from, boolean[] to, SOCResourceSet give, SOCResourceSet get)
          The constructor for a SOCTradeOffer
 
Method Summary
 int getFrom()
           
 java.lang.String getGame()
           
 SOCResourceSet getGetSet()
           
 SOCResourceSet getGiveSet()
           
 boolean[] getTo()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

game

java.lang.String game

give

SOCResourceSet give

get

SOCResourceSet get

from

int from

to

boolean[] to
Constructor Detail

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 made
from - the number of the player making the offer
to - 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 given
get - 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
Method Detail

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