Changeset 169 for code/branches/main_reto_vs05/src/weapon_manager.cc
- Timestamp:
- Nov 5, 2007, 8:43:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/main_reto_vs05/src/weapon_manager.cc
r161 r169 28 28 #include "OgreSceneManager.h" 29 29 30 #include "weapon.h" 30 31 #include "weapon_manager.h" 31 32 32 33 33 namespace Orxonox {34 namespace orxonox { 34 35 using namespace Ogre; 35 36 36 WeaponManager::WeaponManager(SceneManager *mSceneMgr) 37 Weapon** WeaponManager::weaponList_s = NULL; 38 39 WeaponManager::WeaponManager(SceneManager *sceneMgr, SceneNode *node, 40 int slotSize) 41 : sceneMgr_(sceneMgr), node_(node), slotSize_(slotSize), slotIndex_(0) 37 42 { 38 43 slots_ = new Weapon*[slotSize]; 39 44 } 40 45 … … 42 47 WeaponManager::~WeaponManager() 43 48 { 49 if (slots_) 50 delete slots_; 51 } 52 53 54 bool WeaponManager::addWeapon(const Ogre::String &name) 55 { 56 if (name == weaponList_s[0]->name_) 57 { 58 // this is ugly, but for the time being, it has to fit. 59 slots_[slotIndex_++] = weaponList_s[0]; 60 return true; 61 } 62 else 63 return false; 64 } 65 66 67 // static 68 bool WeaponManager::loadWeapons() 69 { 70 weaponList_s[0] = new Weapon("Barrel Gun", 10, 2); 71 return true; 72 } 73 74 75 // static 76 void WeaponManager::destroyWeapons() 77 { 78 delete weaponList_s[0]; 44 79 } 45 80
Note: See TracChangeset
for help on using the changeset viewer.