com.planet_ink.coffee_mud.Common
Class DefaultAuction

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultAuction
All Implemented Interfaces:
AuctionData, CMCommon, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultAuction
extends java.lang.Object
implements AuctionData


Field Summary
 java.lang.String auctionDBKey
           
 Item auctioningI
           
 MOB auctioningM
           
 double bid
           
 double buyOutPrice
           
 java.lang.String currency
           
 double highBid
           
 MOB highBidderM
           
 long start
           
 int state
           
 long tickDown
           
 
Constructor Summary
DefaultAuction()
           
 
Method Summary
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 int daysEllapsed(MOB mob, MOB mob2)
          Returns the number of days ellapsed in this auction.
 int daysRemaining(MOB mob, MOB mob2)
          Returns the number of days remaining in this auction.
 java.lang.String getAuctionDBKey()
          Get the auction database key for this auction
 Item getAuctionedItem()
          Get the item being auctioned.
 MOB getAuctioningMob()
          Get the mob auctioning the item
 int getAuctionState()
          Get the current auction State
 long getAuctionTickDown()
          Get the tick down timer to check stuff
 double getBid()
          Get the current bid in the auction
 double getBuyOutPrice()
          Get the current buy-out price for this auction.
 java.lang.String getCurrency()
          Get the currency the auction is being held in.
 double getHighBid()
          Get the current high bid in the auction
 MOB getHighBidderMob()
          Get the mob who is the high bidder in the auction.
 long getStartTime()
          Get the start time of this auction
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 void setAuctionDBKey(java.lang.String auctionDBKey)
          Set the auction database key for this auction
 void setAuctionedItem(Item auctioningI)
          Set the item being auctioned.
 void setAuctioningMob(MOB auctioningM)
          Set the mob auctioning the item
 void setAuctionState(int state)
          Set the current auction State
 void setAuctionTickDown(long tickDown)
          Set the tick down timer to check stuff
 void setBid(double bid)
          Set the current bid in the auction
 void setBuyOutPrice(double buyOutPrice)
          Set the current buy-out price for this auction.
 void setCurrency(java.lang.String currency)
          Set the currency the auction is being held in.
 void setHighBid(double highBid)
          Set the current high bid in the auction
 void setHighBidderMob(MOB highBidderM)
          Set the mob who is the high bidder in the auction.
 void setStartTime(long start)
          Set the start time of this auction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

auctioningI

public Item auctioningI

auctioningM

public MOB auctioningM

highBidderM

public MOB highBidderM

currency

public java.lang.String currency

highBid

public double highBid

bid

public double bid

buyOutPrice

public double buyOutPrice

state

public int state

tickDown

public long tickDown

start

public long start

auctionDBKey

public java.lang.String auctionDBKey
Constructor Detail

DefaultAuction

public DefaultAuction()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

daysRemaining

public int daysRemaining(MOB mob,
                         MOB mob2)
Description copied from interface: AuctionData
Returns the number of days remaining in this auction. The mobs are only for determining which calendar to use. The first mobs' local calendar gets priority.

Specified by:
daysRemaining in interface AuctionData
Parameters:
mob - the mob whose calendar to use
mob2 - the second mob whose calendar to use
Returns:
the number of days remaining in the auction

daysEllapsed

public int daysEllapsed(MOB mob,
                        MOB mob2)
Description copied from interface: AuctionData
Returns the number of days ellapsed in this auction. The mobs are only for determining which calendar to use. The first mobs' local calendar gets priority.

Specified by:
daysEllapsed in interface AuctionData
Parameters:
mob - the mob whose calendar to use
mob2 - the second mob whose calendar to use
Returns:
the number of days ellapsed in the auction

getAuctionedItem

public Item getAuctionedItem()
Description copied from interface: AuctionData
Get the item being auctioned.

Specified by:
getAuctionedItem in interface AuctionData
Returns:
the item being auctioned.
See Also:
AuctionData.setAuctionedItem(Item)

setAuctionedItem

public void setAuctionedItem(Item auctioningI)
Description copied from interface: AuctionData
Set the item being auctioned.

Specified by:
setAuctionedItem in interface AuctionData
Parameters:
auctioningI - the item being auctioned.
See Also:
AuctionData.getAuctionedItem()

getAuctioningMob

public MOB getAuctioningMob()
Description copied from interface: AuctionData
Get the mob auctioning the item

Specified by:
getAuctioningMob in interface AuctionData
Returns:
the mob auctioning the item
See Also:
AuctionData.setAuctioningMob(MOB)

setAuctioningMob

public void setAuctioningMob(MOB auctioningM)
Description copied from interface: AuctionData
Set the mob auctioning the item

Specified by:
setAuctioningMob in interface AuctionData
Parameters:
auctioningM - the mob auctioning the item
See Also:
AuctionData.getAuctioningMob()

getHighBidderMob

public MOB getHighBidderMob()
Description copied from interface: AuctionData
Get the mob who is the high bidder in the auction.

Specified by:
getHighBidderMob in interface AuctionData
Returns:
the mob who is the high bidder in the auction.
See Also:
AuctionData.setHighBidderMob(MOB)

setHighBidderMob

public void setHighBidderMob(MOB highBidderM)
Description copied from interface: AuctionData
Set the mob who is the high bidder in the auction.

Specified by:
setHighBidderMob in interface AuctionData
Parameters:
highBidderM - the mob who is the high bidder in the auction.
See Also:
AuctionData.getHighBidderMob()

getCurrency

public java.lang.String getCurrency()
Description copied from interface: AuctionData
Get the currency the auction is being held in.

Specified by:
getCurrency in interface AuctionData
Returns:
the currency the auction is being held in.
See Also:
AuctionData.setCurrency(String)

setCurrency

public void setCurrency(java.lang.String currency)
Description copied from interface: AuctionData
Set the currency the auction is being held in.

Specified by:
setCurrency in interface AuctionData
Parameters:
currency - the currency the auction is being held in.
See Also:
AuctionData.getCurrency()

getHighBid

public double getHighBid()
Description copied from interface: AuctionData
Get the current high bid in the auction

Specified by:
getHighBid in interface AuctionData
Returns:
the current high bid in the auction
See Also:
AuctionData.setHighBid(double)

setHighBid

public void setHighBid(double highBid)
Description copied from interface: AuctionData
Set the current high bid in the auction

Specified by:
setHighBid in interface AuctionData
Parameters:
highBid - the current high bid in the auction
See Also:
AuctionData.getHighBid()

getBid

public double getBid()
Description copied from interface: AuctionData
Get the current bid in the auction

Specified by:
getBid in interface AuctionData
Returns:
the current bid in the auction
See Also:
AuctionData.setBid(double)

setBid

public void setBid(double bid)
Description copied from interface: AuctionData
Set the current bid in the auction

Specified by:
setBid in interface AuctionData
Parameters:
bid - the current bid in the auction
See Also:
AuctionData.getBid()

getBuyOutPrice

public double getBuyOutPrice()
Description copied from interface: AuctionData
Get the current buy-out price for this auction.

Specified by:
getBuyOutPrice in interface AuctionData
Returns:
the current buy-out price for this auction.
See Also:
AuctionData.setBuyOutPrice(double)

setBuyOutPrice

public void setBuyOutPrice(double buyOutPrice)
Description copied from interface: AuctionData
Set the current buy-out price for this auction.

Specified by:
setBuyOutPrice in interface AuctionData
Parameters:
buyOutPrice - the current buy-out price for this auction.
See Also:
AuctionData.getBuyOutPrice()

getAuctionState

public int getAuctionState()
Description copied from interface: AuctionData
Get the current auction State

Specified by:
getAuctionState in interface AuctionData
Returns:
the current auction State
See Also:
AuctionData.setAuctionState(int)

setAuctionState

public void setAuctionState(int state)
Description copied from interface: AuctionData
Set the current auction State

Specified by:
setAuctionState in interface AuctionData
Parameters:
state - the current auction State
See Also:
AuctionData.getAuctionState()

getAuctionTickDown

public long getAuctionTickDown()
Description copied from interface: AuctionData
Get the tick down timer to check stuff

Specified by:
getAuctionTickDown in interface AuctionData
Returns:
the tick down timer to check stuff
See Also:
AuctionData.setAuctionTickDown(long)

setAuctionTickDown

public void setAuctionTickDown(long tickDown)
Description copied from interface: AuctionData
Set the tick down timer to check stuff

Specified by:
setAuctionTickDown in interface AuctionData
Parameters:
tickDown - the tick down timer to check stuff
See Also:
AuctionData.getAuctionTickDown()

getStartTime

public long getStartTime()
Description copied from interface: AuctionData
Get the start time of this auction

Specified by:
getStartTime in interface AuctionData
Returns:
the start time of this auction
See Also:
AuctionData.setStartTime(long)

setStartTime

public void setStartTime(long start)
Description copied from interface: AuctionData
Set the start time of this auction

Specified by:
setStartTime in interface AuctionData
Parameters:
start - the start time of this auction
See Also:
AuctionData.getStartTime()

getAuctionDBKey

public java.lang.String getAuctionDBKey()
Description copied from interface: AuctionData
Get the auction database key for this auction

Specified by:
getAuctionDBKey in interface AuctionData
Returns:
the auction database key for this auction
See Also:
AuctionData.setAuctionDBKey(String)

setAuctionDBKey

public void setAuctionDBKey(java.lang.String auctionDBKey)
Description copied from interface: AuctionData
Set the auction database key for this auction

Specified by:
setAuctionDBKey in interface AuctionData
Parameters:
auctionDBKey - the auction database key for this auction
See Also:
AuctionData.getAuctionDBKey()