Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/util/loading/factory.cc @ 4729

Last change on this file since 4729 was 4729, checked in by bensch, 19 years ago

orxonox/trunk: factory-fix

File size: 1.5 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Christian Meyer
13   co-programmer: Benjamin Grauer
14*/
15
16
17#include "factory.h"
18#include "game_loader.h"
19
20using namespace std;
21
22/*  --------------------------------------------------
23 *               Factory
24 *   --------------------------------------------------
25 */
26
27/**
28   \brief constructor
29
30   set everything to zero and define factoryName
31*/
32Factory::Factory (const char* factoryName)
33{
34  this->setClassID(CL_FACTORY, "Factory");
35  this->setName(factoryName);
36
37  next = NULL;
38
39  initialize();
40}
41
42/**
43   \brief destructor
44
45   clear the Q
46*/
47Factory::~Factory ()
48{
49  //  printf("%s\n", this->factoryName);
50  //  Factory* tmpDel = this->next;
51  //  this->next = NULL;
52  if (this->next)
53    delete this->next;
54}
55
56/**
57   \brief generates the associated object from data
58*/
59BaseObject* Factory::fabricate(const TiXmlElement* data)
60{
61  return NULL;
62}
63
64/**
65   \brief make this particular factory known to the LevelFactory
66*/
67void Factory::initialize()
68{
69#ifdef IS_ORXONOX
70  GameLoader::getInstance()->registerFactory( this);
71#endif /* IS_ORXONOX */
72}
73
74/**
75   \brief add a Factory to the Q
76*/
77void Factory::registerFactory( Factory* factory)
78{
79  if( next == NULL) setNext( factory);
80  else next->registerFactory( factory);
81}
82
Note: See TracBrowser for help on using the repository browser.