#include <substance.h>
Inheritance diagram for TSubstanceHold:
Public Methods | |
TSubstanceHold (void) | |
~TSubstanceHold (void) | |
TSubstanceHold (const TSubstanceHold &Hold2) | |
TSubstanceHold & | operator= (const TSubstanceHold &Hold2) |
TOSVal | TotalSpace (const uint2 uCClass) const |
TOSVal | AvailableSpace (const uint2 uCClass) const |
TOSVal | UsedSpace (const uint2 uCClass) const |
void | Clear (void) |
void | Empty (void) |
bool | GetAllFrom (TSubstanceHold *Hold2) |
bool | GetFrom (TSubstanceHold *Hold2, const TSubstanceSet &MaxAbsolute, const TSubstanceSet &MaxRelative) |
bool | SplitOff (TSubstanceHold *Hold2) |
bool | CanAdd (const TSubstanceSet &Set) const |
bool | Add (const TSubstanceSet &Set2, TSubstanceSet *Added) |
bool | CanRemove (const TSubstanceSet &Set, const int4 iNum=1, const int4 iDenom=1) const |
bool | Remove (const TSubstanceSet &Set, TSubstanceSet *Removed, const int4 iNum=1, const int4 iDenom=1) |
bool | CanAdd (const TSubstance &Subst) const |
bool | Add (const TSubstance &Subst, TSubstance *Added) |
bool | CanRemove (const TSubstance &Subst, const int4 iNum=1, const int4 iDenom=1) const |
bool | Remove (const TSubstance &Subst, TSubstance *Removed, const int4 iNum=1, const int4 iDenom=1) |
void | UpdateCargo (void) |
bool | load (TDataPackageList *in, const string &sIdentifier, bool bUnique=true) |
bool | save (TDataPackageList *out, const string &sIdentifier, bool bUnique=true) const |
Private Methods | |
void | In (const TSubstance &s) |
void | Out (const TSubstance &s, const int4 iNum, const int4 iDenom) |
Private Attributes | |
vector< TOSVal > | fTotalSpace |
vector< TOSVal > | fAvailSpace |
Friends | |
ostream & | operator<< (ostream &os, const TSubstanceHold &Hold) |
Substance hold class. This function is derived from TSubstanceSet, but you should act as if it weren't :) It provides similar operation, but guarantees that the total size (positive-sized and negative-sized substances) for a specified cargo class is megative, i.e. you cannot put in more stuff than the space to hold it.
Please check TSubstance for an overview of the substance classes.
|
Determine the size offered/taken by all substances (acts like "remaining cargo space").
Reimplemented from TSubstanceSet. |
|
Clear the set, eliminating all elements it contains. Reimplemented from TSubstanceSet. |
|
With the method Load you can load a TSubstanceHold object from the data packages in the list. For more information look in the documentation of TLinkable.
Reimplemented from TSubstanceSet. |
|
With the method Save you can save a TSubstanceHold object from the data packages in the list. For more information look in the documentation of TLinkable.
Reimplemented from TSubstanceSet. |
|
Determine the size "offered" by negative-sized substances (positive-sized are ignored).
Reimplemented from TSubstanceSet. |
|
Determine the size taken by all positive-sized substances (acts like "how much stuff is stored").
Reimplemented from TSubstanceSet. |