Advanced Strategic Command
Public Member Functions | List of all members
AmmoTransferrable Class Reference
Inheritance diagram for AmmoTransferrable:
Inheritance graph
[legend]

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 More...
 
int getMax (ContainerBase *c, bool avail)
 get maximum amount for that unit. More...
 
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)
 
- Public Member Functions inherited from Transferrable
 Transferrable (ResourceWatch &s, ResourceWatch &d)
 
ContainerBasegetSrcContainer ()
 
ContainerBasegetDstContainer ()
 
bool setDestAmount (long amount)
 
void showAll ()
 
int setAmount (ContainerBase *target, int newamount)
 
void fill (ContainerBase *target)
 
void empty (ContainerBase *target)
 
virtual ~Transferrable ()
 

Additional Inherited Members

- Public Attributes inherited from Transferrable
sigc::signal< void, const
std::string & > 
sigSourceAmount
 
sigc::signal< void, const
std::string & > 
sigDestAmount
 
- Protected Member Functions inherited from Transferrable
ResourceWatchgetResourceWatch (const ContainerBase *unit)
 
ResourceWatchgetOpposingResourceWatch (const ContainerBase *unit)
 
ContainerBaseopposingContainer (const ContainerBase *unit)
 
void show (const ContainerBase *unit)
 
- Protected Attributes inherited from Transferrable
ResourceWatchsource
 
ResourceWatchdest
 

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

void AmmoTransferrable::commit ( const Context context)
virtual
int AmmoTransferrable::getAmount ( const ContainerBase target)
virtual

Implements Transferrable.

Definition at line 540 of file servicing.cpp.

Referenced by getMax().

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
cthe container for which the maximum amount is calculated
availIf 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().

ASCString AmmoTransferrable::getName ( )
virtual

Implements Transferrable.

Definition at line 509 of file servicing.cpp.

References cwaffentypen.

bool AmmoTransferrable::isExchangable ( ) const
virtual

Implements Transferrable.

Definition at line 557 of file servicing.cpp.

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

Implements Transferrable.

Definition at line 545 of file servicing.cpp.

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


The documentation for this class was generated from the following file: