AmmoTransferrable Class Reference

Inheritance diagram for AmmoTransferrable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 AmmoTransferrable (int ammo, ResourceWatch &src, ResourceWatch &dst, bool &allowProduction)
ASCString getName ()
int getID ()
 the id is used to identify the transferrable when serializng to disk. In each service operation, the id must be unique through all transferrables
int getMax (ContainerBase *c, bool avail)
 get maximum amount for that unit.
int getMin (ContainerBase *c, bool avail)
int getAmount (const ContainerBase *target)
int transfer (ContainerBase *target, int delta)
bool isExchangable () const
void commit (const Context &context)

Detailed Description

Definition at line 211 of file servicing.cpp.


Constructor & Destructor Documentation

AmmoTransferrable::AmmoTransferrable ( int  ammo,
ResourceWatch src,
ResourceWatch dst,
bool &  allowProduction 
)

Definition at line 500 of file servicing.cpp.

References ContainerBase::getAmmo(), ResourceWatch::getContainer(), and maxint.


Member Function Documentation

ASCString AmmoTransferrable::getName (  )  [virtual]

Implements Transferrable.

Definition at line 509 of file servicing.cpp.

References cwaffentypen.

int AmmoTransferrable::getID (  )  [virtual]

the id is used to identify the transferrable when serializng to disk. In each service operation, the id must be unique through all transferrables

Implements Transferrable.

Definition at line 514 of file servicing.cpp.

int AmmoTransferrable::getMax ( ContainerBase c,
bool  avail 
) [virtual]

get maximum amount for that unit.

Parameters:
c the container for which the maximum amount is calculated
avail If true, the amount is limited by the resources which can actually provided by the other unit. If false, return the storage capacity

Implements Transferrable.

Definition at line 520 of file servicing.cpp.

References getAmount(), ContainerBase::maxAmmo(), and Transferrable::opposingContainer().

int AmmoTransferrable::getMin ( ContainerBase c,
bool  avail 
) [virtual]

Implements Transferrable.

Definition at line 530 of file servicing.cpp.

References ContainerBase::maxAmmo(), min(), and Transferrable::opposingContainer().

int AmmoTransferrable::getAmount ( const ContainerBase target  )  [virtual]

Implements Transferrable.

Definition at line 540 of file servicing.cpp.

Referenced by getMax().

int AmmoTransferrable::transfer ( ContainerBase target,
int  delta 
) [virtual]

Implements Transferrable.

Definition at line 545 of file servicing.cpp.

References min(), and Transferrable::opposingContainer().

bool AmmoTransferrable::isExchangable (  )  const [virtual]

Implements Transferrable.

Definition at line 557 of file servicing.cpp.

void AmmoTransferrable::commit ( const Context context  )  [virtual]

Implements Transferrable.

Definition at line 562 of file servicing.cpp.

References Transferrable::dest, ResourceWatch::getContainer(), and Transferrable::source.


The documentation for this class was generated from the following file:
Generated on Mon May 21 01:46:16 2012 for Advanced Strategic Command by  doxygen 1.5.1