#include <link.h>
Inheritance diagram for TLinkable:
Public Methods | |
const TObjectID & | getID () const |
const TLinkBaseList & | getLinkedByList () const |
int4 | getNumberOfLinks () const |
virtual int2 | getType () const |
virtual const string & | getTypeName () const |
virtual bool | load (TDataPackageList *in) |
virtual bool | save (TDataPackageList *out) const |
Protected Methods | |
TLinkable () | |
virtual | ~TLinkable () |
virtual void | reset () |
Private Methods | |
TLinkable (const TLinkable &Src) | |
void | addInverseLink (TLinkBase *p) |
TLinkable & | operator= (const TLinkable &Src) |
void | removeInverseLink (TLinkBase *p) |
Private Attributes | |
TObjectID | ID |
TLinkBaseList | LinkedBy |
Static Private Attributes | |
TObjectID | UniqueID |
Friends | |
class | TLinkBase |
class | TLinkUpdate |
If the object is deleted all links pointing to the object are automatically resetted.
FIXME: add example / usage
|
Generates a unique ID for the object. Making the constructor protected forbids creating objects of the type TLinkable. |
|
Resets all links pointing to this object. This of course needs the LinkedBy list.
|
|
The copy constructor is not implemented since it is forbidden to copy a TLinkable object. IDs have to be unique. This is also the reason for making the copy constructor private: to make it impossible to copy this object. |
|
Adds a link to the LinkedBy list.
|
|
|
|
|
|
|
|
Reimplemented from TType. Reimplemented in TAction, TFleet, TGalaxy, TItem, TShipDesign, TStellarObject, TSubFleet, and TSystem. |
|
Reimplemented from TType. Reimplemented in TAction, TFleet, TGalaxy, TItem, TShipDesign, TStellarObject, TSubFleet, and TSystem. |
|
Loads a TLinkable. Note that classes that are derived from this class must call TLinkable::Load explicitly to load the data correctly.
Reimplemented in TAction, TActionObject, TFleet, TGalaxy, TItem, TSTLEngine, TFTLEngine, TFuelTank, TFuelScoop, TCargoBay, TColonizer, TRepairBot, TDefenseType, TArmorType, TShieldType, TArmor, TShield, TWeapon, TKWeapon, TEWeapon, TTargetingComputer, TScanner, TScannerNormalActive, TScannerNormalPassive, TScannerAntiDisguiseActive, TScannerAntiDisguisePassive, TScannerAntiCloakActive, TScannerAntiCloakPassive, TScannerPenetrateActive, TScannerPenetratePassive, TJammer, TJammerNormal, TJammerDisguise, TJammerCloak, TJammerAntiPenetrate, TMineLayer, TMiningBot, TFighterLauncher, TSPWeaponLauncher, TProperty, TRace, TShipDesign, TStellarObject, TSubFleet, TSubstanceType, TSystem, and TSubFleetBasic. |
|
Copying a TLinkable object is forbidden since all objects have to have different IDs. That's why this method is private and is doing nothing. |
|
Removes a link from the LinkedBy list.
|
|
Resets all values (this will also reset all links pointing to this object). Reimplemented in TUniverse. |
|
|
The ID of this object. |
|
List of links to TLinkable objects linking this object. |
|
This counter always points to the next unique ID. |