Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ModuleFactory Class Reference

#include <ModuleFactory.h>

Inherits SubsystemInterface, and Snapshot.

Inherited by W3DModuleFactory.

Classes

class  ModuleTemplate
 

Public Member Functions

 ModuleFactory (void)
 
virtual ~ModuleFactory (void)
 
virtual void init (void)
 
virtual void reset (void)
 We don't reset during the lifetime of the app.
 
virtual void update (void)
 As of now, we don't have a need for an update.
 
ModulenewModule (Thing *thing, const AsciiString &name, const ModuleData *data, ModuleType type)
 allocate a new module
 
ModuleDatanewModuleDataFromINI (INI *ini, const AsciiString &name, ModuleType type, const AsciiString &moduleTag)
 
Int findModuleInterfaceMask (const AsciiString &name, ModuleType type)
 
virtual void crc (Xfer *xfer)
 run the "light" crc check on this data structure
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Protected Types

typedef std::map< NameKeyType, ModuleTemplate, std::less< NameKeyType > > ModuleTemplateMap
 
typedef std::vector< const ModuleData * > ModuleDataList
 

Protected Member Functions

const ModuleTemplatefindModuleTemplate (const AsciiString &name, ModuleType type)
 
void addModuleInternal (NewModuleProc proc, NewModuleDataProc dataproc, ModuleType type, const AsciiString &name, Int whichIntf)
 adding a new module template to the factory, and assisting macro to make it easier
 

Static Protected Member Functions

static NameKeyType makeDecoratedNameKey (const AsciiString &name, ModuleType type)
 

Protected Attributes

ModuleTemplateMap m_moduleTemplateMap
 
ModuleDataList m_moduleDataList
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

We use TheModulyFactory to register classes that will be attached to objects and drawables which will be executed or "called back" in the correct situations ... such as Die, Damage, Update etc or just as a place to store data specific to that type of thing

Definition at line 68 of file ModuleFactory.h.

Member Typedef Documentation

◆ ModuleDataList

typedef std::vector<const ModuleData*> ModuleFactory::ModuleDataList
protected

Definition at line 120 of file ModuleFactory.h.

◆ ModuleTemplateMap

typedef std::map< NameKeyType, ModuleTemplate, std::less<NameKeyType> > ModuleFactory::ModuleTemplateMap
protected

Definition at line 119 of file ModuleFactory.h.

Constructor & Destructor Documentation

◆ ModuleFactory()

ModuleFactory::ModuleFactory ( void )

Definition at line 297 of file ModuleFactory.cpp.

◆ ~ModuleFactory()

ModuleFactory::~ModuleFactory ( void )
virtual

Definition at line 306 of file ModuleFactory.cpp.

Member Function Documentation

◆ addModuleInternal()

void ModuleFactory::addModuleInternal ( NewModuleProc proc,
NewModuleDataProc dataproc,
ModuleType type,
const AsciiString & name,
Int whichIntf )
protected

adding a new module template to the factory, and assisting macro to make it easier

Add a module template to our list of templates

Definition at line 695 of file ModuleFactory.cpp.

◆ crc()

void ModuleFactory::crc ( Xfer * xfer)
virtual

run the "light" crc check on this data structure

Implements Snapshot.

Definition at line 705 of file ModuleFactory.cpp.

◆ findModuleInterfaceMask()

Int ModuleFactory::findModuleInterfaceMask ( const AsciiString & name,
ModuleType type )

Definition at line 570 of file ModuleFactory.cpp.

◆ findModuleTemplate()

const ModuleFactory::ModuleTemplate * ModuleFactory::findModuleTemplate ( const AsciiString & name,
ModuleType type )
protected

Definition at line 615 of file ModuleFactory.cpp.

◆ init()

void ModuleFactory::init ( void )
virtual

Initialize the module factory. Any class that needs to be attached to objects or drawables as modules needs to add a template for that class here

Implements SubsystemInterface.

Reimplemented in W3DModuleFactory.

Definition at line 324 of file ModuleFactory.cpp.

◆ loadPostProcess()

void ModuleFactory::loadPostProcess ( void )
virtual

post process phase for loading save games. All save systems have their xfer run using XferLoad mode, and then all systems each have their post process run

Implements Snapshot.

Definition at line 729 of file ModuleFactory.cpp.

◆ makeDecoratedNameKey()

NameKeyType ModuleFactory::makeDecoratedNameKey ( const AsciiString & name,
ModuleType type )
staticprotected

Definition at line 606 of file ModuleFactory.cpp.

◆ newModule()

Module * ModuleFactory::newModule ( Thing * thing,
const AsciiString & name,
const ModuleData * moduleData,
ModuleType type )

allocate a new module

Allocate a new acton class istance given the name

Definition at line 634 of file ModuleFactory.cpp.

◆ newModuleDataFromINI()

ModuleData * ModuleFactory::newModuleDataFromINI ( INI * ini,
const AsciiString & name,
ModuleType type,
const AsciiString & moduleTag )

Definition at line 585 of file ModuleFactory.cpp.

◆ reset()

virtual void ModuleFactory::reset ( void )
inlinevirtual

We don't reset during the lifetime of the app.

Implements SubsystemInterface.

Definition at line 77 of file ModuleFactory.h.

◆ update()

virtual void ModuleFactory::update ( void )
inlinevirtual

As of now, we don't have a need for an update.

Implements SubsystemInterface.

Definition at line 78 of file ModuleFactory.h.

◆ xfer()

void ModuleFactory::xfer ( Xfer * xfer)
virtual

run save, load, or deep CRC check on this data structure, the type depends on the setup of the Xfer pointer

Implements Snapshot.

Definition at line 714 of file ModuleFactory.cpp.

Member Data Documentation

◆ m_moduleDataList

ModuleDataList ModuleFactory::m_moduleDataList
protected

Definition at line 123 of file ModuleFactory.h.

◆ m_moduleTemplateMap

ModuleTemplateMap ModuleFactory::m_moduleTemplateMap
protected

Definition at line 122 of file ModuleFactory.h.


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