[4245] | 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: Patrick Boenzli |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_OBJECT_MANAGER |
---|
| 17 | |
---|
| 18 | #include "object_manager.h" |
---|
[4286] | 19 | #include "list.h" |
---|
| 20 | #include "world_entity.h" |
---|
[4245] | 21 | |
---|
| 22 | using namespace std; |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | /** |
---|
| 26 | \brief standard constructor |
---|
| 27 | */ |
---|
| 28 | ObjectManager::ObjectManager () |
---|
| 29 | { |
---|
[4286] | 30 | this->setClassName ("ObjectManager"); |
---|
| 31 | |
---|
| 32 | //this->managedObjectList = new BaseObject*[CL_NUMBER]; |
---|
| 33 | this->managedObjectList = new tList<BaseObject>*[CL_NUMBER]; |
---|
[4245] | 34 | } |
---|
| 35 | |
---|
| 36 | /** |
---|
| 37 | \brief the singleton reference to this class |
---|
| 38 | */ |
---|
| 39 | ObjectManager* ObjectManager::singletonRef = NULL; |
---|
| 40 | |
---|
| 41 | /** |
---|
| 42 | \returns a Pointer to this Class |
---|
| 43 | */ |
---|
| 44 | ObjectManager* ObjectManager::getInstance(void) |
---|
| 45 | { |
---|
| 46 | if (!ObjectManager::singletonRef) |
---|
| 47 | ObjectManager::singletonRef = new ObjectManager(); |
---|
| 48 | return ObjectManager::singletonRef; |
---|
| 49 | } |
---|
| 50 | |
---|
[4285] | 51 | |
---|
[4245] | 52 | /** |
---|
| 53 | \brief standard deconstructor |
---|
| 54 | |
---|
| 55 | */ |
---|
| 56 | ObjectManager::~ObjectManager () |
---|
| 57 | { |
---|
| 58 | ObjectManager::singletonRef = NULL; |
---|
[4285] | 59 | } |
---|
[4245] | 60 | |
---|
[4285] | 61 | |
---|
[4286] | 62 | void ObjectManager::cache(classList index, int number, const BaseObject ©Object) |
---|
[4285] | 63 | { |
---|
[4286] | 64 | //this->managedObjectList[index] = new BaseObject[number]; |
---|
| 65 | this->managedObjectList[index] = new tList<BaseObject>(); |
---|
| 66 | for(int i = 0; i < number; ++i) |
---|
| 67 | { |
---|
| 68 | this->managedObjectList[index]->add(new BaseObject(copyObject)); |
---|
| 69 | } |
---|
[4245] | 70 | } |
---|
[4285] | 71 | |
---|
| 72 | |
---|
| 73 | void ObjectManager::addToDeadList(const char* className, BaseObject* object) |
---|
| 74 | {} |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | BaseObject* ObjectManager::getFromDeadList(const char* className, int number) |
---|
| 78 | {} |
---|