
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) |
Definition at line 211 of file servicing.cpp.
| 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.
| ASCString AmmoTransferrable::getName | ( | ) | [virtual] |
| 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.
| 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] |
| 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] |
| 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.
1.5.1