Ares
Public Types | Public Member Functions

SW_UnitDelivery Class Reference

#include <src/Misc/SWTypes/UnitDelivery.h>

Inheritance diagram for SW_UnitDelivery:
NewSWType

List of all members.

Public Types

typedef UnitDeliveryStateMachine TStateMachine

Public Member Functions

 SW_UnitDelivery ()
virtual ~SW_UnitDelivery ()
virtual const char * GetTypeString ()
virtual void LoadFromINI (SWTypeExt::ExtData *pData, SuperWeaponTypeClass *pSW, CCINIClass *pINI)
virtual void Initialize (SWTypeExt::ExtData *pData, SuperWeaponTypeClass *pSW)
virtual bool Launch (SuperClass *pThis, CellStruct *pCoords, byte IsPlayer)
void newStateMachine (int Duration, CellStruct XY, SuperClass *pSuper)

Member Typedef Documentation


Constructor & Destructor Documentation

SW_UnitDelivery::SW_UnitDelivery ( ) [inline]
                                  : NewSWType()
                        { };
virtual SW_UnitDelivery::~SW_UnitDelivery ( ) [inline, virtual]
                        { };

Member Function Documentation

virtual const char* SW_UnitDelivery::GetTypeString ( ) [inline, virtual]

Reimplemented from NewSWType.

                        { return "UnitDelivery"; }
void SW_UnitDelivery::Initialize ( SWTypeExt::ExtData pData,
SuperWeaponTypeClass *  pSW 
) [virtual]
bool SW_UnitDelivery::Launch ( SuperClass *  pThis,
CellStruct *  pCoords,
byte  IsPlayer 
) [virtual]

Implements NewSWType.

{
        this->newStateMachine(150, *pCoords, pThis);

        return 1;
}
void SW_UnitDelivery::LoadFromINI ( SWTypeExt::ExtData pData,
SuperWeaponTypeClass *  pSW,
CCINIClass *  pINI 
) [virtual]

Reimplemented from NewSWType.

{
        const char * section = pSW->ID;

        if(!pINI->GetSection(section)) {
                return;
        }

        if(pINI->ReadString(section, "Deliver.Types", "", Ares::readBuffer, Ares::readLength)) {
                pData->SW_Deliverables.Clear();
                for(char *cur = strtok(Ares::readBuffer, ","); cur && *cur; cur = strtok(NULL, ",")) {
                        TechnoTypeClass * Type = InfantryTypeClass::Find(cur);
                        if(!Type) {
                                Type = UnitTypeClass::Find(cur);
                        }
                        if(!Type) {
                                Type = AircraftTypeClass::Find(cur);
                        }
                        if(!Type) {
                                Type = BuildingTypeClass::Find(cur);
                        }
                        if(!Type) {
                                Debug::INIParseFailed(section, "Deliver.Types", cur, "Expected valid TechnoType ID.");
                        }
                        if(Type) {
                                pData->SW_Deliverables.AddItem(Type);
                        }
                }
        }

        INI_EX exINI(pINI);
        pData->SW_DeliverBuildups.Read(&exINI, section, "Deliver.Buildups");
}
void SW_UnitDelivery::newStateMachine ( int  Duration,
CellStruct  XY,
SuperClass *  pSuper 
) [inline]
                                                                              {
                new TStateMachine(Duration, XY, pSuper, this);
        }

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines