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

#include <ThingFactory.h>

Inherits SubsystemInterface.

Inherited by W3DThingFactory.

Public Member Functions

 ThingFactory (void)
 
virtual ~ThingFactory (void)
 
virtual void init (void)
 
virtual void postProcessLoad (void)
 
virtual void reset (void)
 
virtual void update (void)
 
ThingTemplatenewTemplate (const AsciiString &name)
 create a new template with name 'name' and add to template list
 
const ThingTemplatefirstTemplate (void)
 
const ThingTemplatefindTemplate (const AsciiString &name, Bool check=TRUE)
 
const ThingTemplatefindByTemplateID (UnsignedShort id)
 
ObjectnewObject (const ThingTemplate *tmplate, Team *team, ObjectStatusMaskType statusMask=OBJECT_STATUS_MASK_NONE)
 
DrawablenewDrawable (const ThingTemplate *tmplate, DrawableStatus statusBits=DRAWABLE_STATUS_NONE)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Static Public Member Functions

static void parseObjectDefinition (INI *ini, const AsciiString &name, const AsciiString &reskinFrom)
 

Additional Inherited Members

- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

Implementation of the thing manager interface singleton

Definition at line 55 of file ThingFactory.h.

Constructor & Destructor Documentation

◆ ThingFactory()

ThingFactory::ThingFactory ( void )

Definition at line 109 of file ThingFactory.cpp.

◆ ~ThingFactory()

ThingFactory::~ThingFactory ( void )
virtual

Definition at line 119 of file ThingFactory.cpp.

Member Function Documentation

◆ findByTemplateID()

const ThingTemplate * ThingFactory::findByTemplateID ( UnsignedShort id)

get a template given ID. return null if not found. note, this is not particularly fast (does a linear search).

Return the template with the matching database name

Definition at line 255 of file ThingFactory.cpp.

◆ findTemplate()

const ThingTemplate * ThingFactory::findTemplate ( const AsciiString & name,
Bool check = TRUE )
inline

get a template given template database name. return null if not found. note, this is now substantially faster (does a hash-table lookup)

Definition at line 79 of file ThingFactory.h.

◆ firstTemplate()

const ThingTemplate * ThingFactory::firstTemplate ( void )
inline

Definition at line 73 of file ThingFactory.h.

◆ init()

void ThingFactory::init ( void )
virtual

Init

Implements SubsystemInterface.

Definition at line 201 of file ThingFactory.cpp.

◆ newDrawable()

Drawable * ThingFactory::newDrawable ( const ThingTemplate * tmplate,
DrawableStatus statusBits = DRAWABLE_STATUS_NONE )

request a new drawable using the given template. this will throw an exception on failure; it will never return null.

Todo
we should keep track of all the drawables we've allocated here but we'll wait until we have an drawable storage to do that cause it will all be tied together

Definition at line 350 of file ThingFactory.cpp.

◆ newObject()

Object * ThingFactory::newObject ( const ThingTemplate * tmplate,
Team * team,
ObjectStatusMaskType statusMask = OBJECT_STATUS_MASK_NONE )

request a new object using the given template. this will throw an exception on failure; it will never return null.

Definition at line 305 of file ThingFactory.cpp.

◆ newTemplate()

ThingTemplate * ThingFactory::newTemplate ( const AsciiString & name)

create a new template with name 'name' and add to template list

Create a new template with name 'name' and add to our template list

Definition at line 130 of file ThingFactory.cpp.

◆ parseObjectDefinition()

void ThingFactory::parseObjectDefinition ( INI * ini,
const AsciiString & name,
const AsciiString & reskinFrom )
static

Parse Object entry

Definition at line 372 of file ThingFactory.cpp.

◆ postProcessLoad()

void ThingFactory::postProcessLoad ( void )
virtual

Post process phase after loading the database files

Reimplemented from SubsystemInterface.

Definition at line 514 of file ThingFactory.cpp.

◆ reset()

void ThingFactory::reset ( void )
virtual

Reset

Implements SubsystemInterface.

Definition at line 209 of file ThingFactory.cpp.

◆ update()

void ThingFactory::update ( void )
virtual

Update

Implements SubsystemInterface.

Definition at line 247 of file ThingFactory.cpp.


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