Changeset 9709 in orxonox.OLD for branches/new_class_id/src/world_entities
- Timestamp:
- Aug 31, 2006, 10:51:08 PM (18 years ago)
- Location:
- branches/new_class_id/src/world_entities
- Files:
-
- 125 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/bsp_entity.cc
r9656 r9709 18 18 #include "util/loading/resource_manager.h" 19 19 20 CREATE_FACTORY(BspEntity, CL_BSP_ENTITY); 20 #include "class_id.h" 21 NewObjectListDefinitionID(BspEntity, CL_BSP_ENTITY); 22 CREATE_FACTORY(BspEntity); 21 23 22 24 … … 51 53 void BspEntity::init() 52 54 { 55 this->registerObject(this, BspEntity::_objectList); 53 56 54 57 this->bspManager = NULL; … … 69 72 if ( File(ResourceManager::getFullName(name)).exists() ) { 70 73 71 this->setClassID(CL_BSP_ENTITY, "BspEntity");72 74 this->bspManager = new BspManager(this); 73 75 -
branches/new_class_id/src/world_entities/character_attributes.cc
r9406 r9709 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 18 18 19 19 #include "character_attributes.h" 20 #include "stdincl.h" 21 22 20 21 22 NewObjectListDefinition(CharacterAttributes); 23 23 24 24 … … 27 27 @todo this constructor is not jet implemented - do it 28 28 */ 29 CharacterAttributes::CharacterAttributes () 30 { 31 this->setClassID(CL_CHARACTER_ATTRIBUTES, "CharacterAttributes");29 CharacterAttributes::CharacterAttributes () 30 { 31 this->registerObject(this, CharacterAttributes::_objectList); 32 32 } 33 33 … … 37 37 38 38 */ 39 CharacterAttributes::~CharacterAttributes () 39 CharacterAttributes::~CharacterAttributes () 40 40 { 41 41 } … … 97 97 98 98 /** 99 * sets maximum health 99 * sets maximum health 100 100 * @param health 101 101 … … 130 130 * adds shield strength 131 131 * @param strength 132 132 133 133 there is currently no limit to shieldstrength 134 134 */ … … 290 290 /*=====================energy=====================*/ 291 291 /** 292 * sets the amount of energy 292 * sets the amount of energy 293 293 * @param energy 294 294 */ … … 332 332 333 333 /** 334 * gets the amount of energy 334 * gets the amount of energy 335 335 * @returns energy 336 336 */ … … 358 358 return this->energyConsumption; 359 359 } 360 360 361 361 362 362 /** -
branches/new_class_id/src/world_entities/character_attributes.h
r5039 r9709 15 15 */ 16 16 class CharacterAttributes : public BaseObject { 17 NewObjectListDeclaration(CharacterAttributes); 17 18 18 19 public: -
branches/new_class_id/src/world_entities/creatures/fps_player.cc
r9494 r9709 32 32 33 33 #include "aabb.h" 34 34 #include "bsp_entity.h" 35 35 36 36 #include "key_mapper.h" … … 41 41 42 42 43 44 CREATE_FACTORY(FPSPlayer, CL_FPS_PLAYER); 43 #include "class_id.h" 44 NewObjectListDefinitionID(FPSPlayer, CL_FPS_PLAYER); 45 CREATE_FACTORY(FPSPlayer); 45 46 46 47 #include "script_class.h" 47 CREATE_SCRIPTABLE_CLASS(FPSPlayer, CL_FPS_PLAYER,48 CREATE_SCRIPTABLE_CLASS(FPSPlayer, FPSPlayer::classID(), 48 49 addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 49 50 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) … … 85 86 void FPSPlayer::init() 86 87 { 87 this-> setClassID(CL_FPS_PLAYER, "FPSPlayer");88 this->registerObject(this, FPSPlayer::_objectList); 88 89 89 90 this->bLeft = false; … … 166 167 167 168 //subscribe to collision reaction 168 this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, CL_BSP_ENTITY);169 this->subscribeReaction(CREngine::CR_PHYSICS_FULL_WALK, BspEntity::classID()); 169 170 170 171 this->initWeapon = false; -
branches/new_class_id/src/world_entities/creatures/fps_player.h
r9235 r9709 16 16 class FPSPlayer : public Playable 17 17 { 18 NewObjectListDeclaration(FPSPlayer); 18 19 19 20 public: -
branches/new_class_id/src/world_entities/creatures/md2_creature.cc
r8724 r9709 37 37 #include "debug.h" 38 38 39 CREATE_FACTORY(MD2Creature, CL_MD2_CREATURE); 39 #include "class_id.h" 40 NewObjectListDefinitionID(MD2Creature, CL_MD2_CREATURE); 41 CREATE_FACTORY(MD2Creature); 40 42 41 43 /** … … 86 88 PRINTF(4)("MD2CREATURE INIT\n"); 87 89 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 88 this-> setClassID(CL_MD2_CREATURE, "MD2Creature");90 this->registerObject(this, MD2Creature::_objectList); 89 91 90 92 this->toList(OM_GROUP_01); … … 95 97 Weapon* wpLeft = new TestGun(1); 96 98 wpLeft->setName("testGun Left"); 97 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_CANNON));99 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon")); 98 100 99 101 cannon->setName("BFG"); … … 112 114 this->cameraConnNode.addChild(State::getCameraNode()); 113 115 State::getCameraTargetNode()->setRelCoor(10,0,0); 114 116 115 117 116 118 -
branches/new_class_id/src/world_entities/creatures/md2_creature.h
r8724 r9709 16 16 class MD2Creature : public Playable 17 17 { 18 NewObjectListDeclaration(MD2Creature); 18 19 19 20 public: -
branches/new_class_id/src/world_entities/effects/billboard.cc
r9707 r9709 27 27 28 28 #include "class_id.h" 29 CREATE_FACTORY(Billboard, CL_BILLBOARD);30 29 NewObjectListDefinitionID(Billboard, CL_BILLBOARD); 30 CREATE_FACTORY(Billboard); 31 31 32 32 /** -
branches/new_class_id/src/world_entities/effects/explosion.cc
r9707 r9709 18 18 #include "explosion.h" 19 19 20 #include " fast_factory.h"20 #include "loading/fast_factory.h" 21 21 22 22 #include "state.h" … … 28 28 29 29 #include "class_id.h" 30 NewObjectListDefinitionID(Explosion, CL_EXPLOSION); 30 31 CREATE_FAST_FACTORY_STATIC(Explosion); 31 NewObjectListDefinitionID(Explosion, CL_EXPLOSION);32 32 33 33 /** -
branches/new_class_id/src/world_entities/effects/lightning_bolt.cc
r9406 r9709 25 25 26 26 27 28 CREATE_FACTORY(LightningBolt, CL_LIGHTNING_BOLT);29 27 #include "class_id.h" 28 NewObjectListDefinitionID(LightningBolt, CL_LIGHTNING_BOLT); 29 CREATE_FACTORY(LightningBolt); 30 30 31 31 /** … … 34 34 LightningBolt::LightningBolt (const TiXmlElement* root) 35 35 { 36 this-> setClassID(CL_LIGHTNING_BOLT, "LightningBolt");36 this->registerObject(this, LightningBolt::_objectList); 37 37 38 38 this->toList(OM_COMMON); -
branches/new_class_id/src/world_entities/effects/lightning_bolt.h
r7460 r9709 21 21 class LightningBolt : public WorldEntity 22 22 { 23 NewObjectListDeclaration(LightningBolt); 23 24 public: 24 25 LightningBolt(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/elements/image_entity.cc
r9406 r9709 30 30 31 31 32 CREATE_FACTORY(ImageEntity, CL_IMAGE_ENTITY); 32 #include "class_id.h" 33 NewObjectListDefinitionID(ImageEntity, CL_IMAGE_ENTITY); 34 CREATE_FACTORY(ImageEntity); 33 35 34 36 … … 59 61 void ImageEntity::init() 60 62 { 61 this-> setClassID(CL_IMAGE_ENTITY, "ImageEntity");63 this->registerObject(this, ImageEntity::_objectList); 62 64 this->setName("ImageEntity"); 63 65 -
branches/new_class_id/src/world_entities/elements/image_entity.h
r7751 r9709 21 21 //! A class that enables the 22 22 class ImageEntity : public PNode, public Element2D { 23 NewObjectListDeclaration(ImageEntity); 23 24 24 25 public: -
branches/new_class_id/src/world_entities/elements/text_element.cc
r9406 r9709 27 27 28 28 29 30 CREATE_FACTORY(TextElement, CL_TEXT_ELEMENT); 29 #include "class_id.h" 30 NewObjectListDefinitionID(TextElement, CL_TEXT_ELEMENT); 31 CREATE_FACTORY(TextElement); 31 32 32 33 … … 36 37 TextElement::TextElement (const TiXmlElement* root) 37 38 { 38 this-> setClassID(CL_TEXT_ELEMENT, "TextElement");39 this->registerObject(this, TextElement::_objectList); 39 40 this->setName("TextElement"); 40 41 -
branches/new_class_id/src/world_entities/elements/text_element.h
r7221 r9709 21 21 //! A class that enables the 22 22 class TextElement : public Text { 23 NewObjectListDeclaration(TextElement); 23 24 24 25 public: -
branches/new_class_id/src/world_entities/environment.cc
r9406 r9709 22 22 #include "util/loading/resource_manager.h" 23 23 24 #include "vector.h"25 24 #include "objModel.h" 26 25 #include "obb_tree.h" 27 26 #include "util/loading/factory.h" 28 27 29 30 CREATE_FACTORY(Environment, CL_ENVIRONMENT); 28 #include "class_id.h" 29 NewObjectListDefinitionID(Environment, CL_ENVIRONMENT); 30 CREATE_FACTORY(Environment); 31 31 32 32 /** … … 63 63 void Environment::init() 64 64 { 65 this-> setClassID(CL_ENVIRONMENT, "Environment");65 this->registerObject(this, Environment::_objectList); 66 66 this->toList(OM_ENVIRON); 67 67 } -
branches/new_class_id/src/world_entities/environment.h
r6512 r9709 16 16 class Environment : public WorldEntity 17 17 { 18 friend class World;18 NewObjectListDeclaration(Environment); 19 19 20 20 public: -
branches/new_class_id/src/world_entities/environments/building.cc
r9406 r9709 23 23 24 24 25 26 CREATE_FACTORY(Building, CL_BUILDING); 25 #include "class_id.h" 26 NewObjectListDefinitionID(Building, CL_BUILDING); 27 CREATE_FACTORY(Building); 27 28 28 29 /** … … 31 32 Building::Building(const TiXmlElement* root) 32 33 { 33 this-> setClassID(CL_BUILDING, "Building");34 this->registerObject(this, Building::_objectList); 34 35 this->toList(OM_ENVIRON_NOTICK); 35 36 -
branches/new_class_id/src/world_entities/environments/building.h
r7041 r9709 15 15 class Building : public WorldEntity 16 16 { 17 public: 17 NewObjectListDeclaration(Building); 18 public: 18 19 Building(const TiXmlElement* root); 19 20 -
branches/new_class_id/src/world_entities/environments/mapped_water.cc
r9406 r9709 25 25 #include "script_class.h" 26 26 27 CREATE_FACTORY(MappedWater, CL_MAPPED_WATER); 27 #include "class_id.h" 28 NewObjectListDefinitionID(MappedWater, CL_MAPPED_WATER); 29 CREATE_FACTORY(MappedWater); 28 30 29 31 SHELL_COMMAND(gui, MappedWater, toggleGui); 30 32 SHELL_COMMAND(output, MappedWater, saveParams); 31 33 32 CREATE_SCRIPTABLE_CLASS(MappedWater, CL_MAPPED_WATER,34 CREATE_SCRIPTABLE_CLASS(MappedWater, MappedWater::classID(), 33 35 addMethod("waterUV", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterUV)) 34 36 ->addMethod("waterFlow", ExecutorLua2<MappedWater, float, float>(&MappedWater::fadeWaterFlow)) … … 47 49 MappedWater::MappedWater(const TiXmlElement* root) 48 50 { 49 this-> setClassID(CL_MAPPED_WATER, "MappedWater");51 this->registerObject(this, MappedWater::_objectList); 50 52 this->toList(OM_ENVIRON); 51 53 -
branches/new_class_id/src/world_entities/environments/mapped_water.h
r9021 r9709 35 35 class MappedWater : public WorldEntity 36 36 { 37 NewObjectListDeclaration(MappedWater); 37 38 public: 38 39 MappedWater(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/environments/model_entity.cc
r9656 r9709 23 23 24 24 25 26 CREATE_FACTORY(ModelEntity, CL_MODEL_ENTITY); 25 #include "class_id.h" 26 NewObjectListDefinitionID(ModelEntity, CL_MODEL_ENTITY); 27 CREATE_FACTORY(ModelEntity); 27 28 28 29 /** … … 31 32 ModelEntity::ModelEntity(const TiXmlElement* root) 32 33 { 33 this-> setClassID(CL_MODEL_ENTITY, "ModelEntity");34 this->registerObject(this, ModelEntity::_objectList); 34 35 this->toList(OM_ENVIRON); 35 36 -
branches/new_class_id/src/world_entities/environments/model_entity.h
r7048 r9709 15 15 class ModelEntity : public WorldEntity 16 16 { 17 NewObjectListDeclaration(ModelEntity); 17 18 public: 18 19 ModelEntity(const TiXmlElement* root); -
branches/new_class_id/src/world_entities/environments/water.cc
r9656 r9709 33 33 34 34 35 36 CREATE_FACTORY(Water, CL_WATER); 35 #include "class_id.h" 36 NewObjectListDefinitionID(Water, CL_WATER); 37 CREATE_FACTORY(Water); 37 38 38 39 39 40 Water::Water(const TiXmlElement* root) 40 41 { 41 this-> setClassID(CL_WATER, "Water");42 this->registerObject(this, Water::_objectList); 42 43 this->toList(OM_ENVIRON); 43 44 … … 217 218 void Water::tick(float dt) 218 219 { 219 ObjectManager::EntityList entityList = State::getObjectManager()->get ObjectList(OM_GROUP_01_PROJ);220 ObjectManager::EntityList entityList = State::getObjectManager()->getEntityList(OM_GROUP_01_PROJ); 220 221 ObjectManager::EntityList::iterator entity = entityList.begin(); 221 222 while (entity != entityList.end()) -
branches/new_class_id/src/world_entities/environments/water.h
r7954 r9709 22 22 class Water : public WorldEntity 23 23 { 24 public: 24 NewObjectListDeclaration(Water); 25 public: 25 26 Water(const TiXmlElement* root = NULL); 26 27 virtual ~Water(); … … 38 39 void draw() const; 39 40 void tick(float dt); 40 41 41 42 virtual void varChangeHandler( std::list<int> & id ); 42 43 … … 52 53 Material waterMaterial; 53 54 Shader* waterShader; 54 55 55 56 float height; //!< The hight of the Water 56 57 int height_handle; //!< Handle to notify about changes of height -
branches/new_class_id/src/world_entities/movie_entity.cc
r9406 r9709 21 21 22 22 23 24 CREATE_FACTORY(MovieEntity, CL_MOVIE_ENTITY); 23 #include "class_id.h" 24 NewObjectListDefinitionID(MovieEntity, CL_MOVIE_ENTITY); 25 CREATE_FACTORY(MovieEntity); 25 26 26 27 /** … … 29 30 MovieEntity::MovieEntity (const TiXmlElement* root) 30 31 { 31 this-> setClassID(CL_MOVIE_ENTITY, "MovieEntity");32 this->registerObject(this, MovieEntity::_objectList); 32 33 33 34 media_container = new MediaContainer(); -
branches/new_class_id/src/world_entities/movie_entity.h
r7221 r9709 14 14 class MovieEntity : public WorldEntity 15 15 { 16 NewObjectListDeclaration(MovieEntity); 16 17 private: 17 18 MediaContainer* media_container; -
branches/new_class_id/src/world_entities/npcs/attractor_mine.cc
r9235 r9709 33 33 #include "effects/explosion.h" 34 34 35 CREATE_FACTORY(AttractorMine, CL_ATTRACTOR_MINE); 35 #include "class_id.h" 36 NewObjectListDefinitionID(AttractorMine, CL_ATTRACTOR_MINE); 37 CREATE_FACTORY(AttractorMine); 36 38 #include "script_class.h" 37 CREATE_SCRIPTABLE_CLASS(AttractorMine, CL_ATTRACTOR_MINE,39 CREATE_SCRIPTABLE_CLASS(AttractorMine, AttractorMine::classID(), 38 40 addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName)) 39 41 //Coordinates … … 50 52 : NPC(NULL) 51 53 { 52 this-> setClassID(CL_ATTRACTOR_MINE, "AttractorMine");54 this->registerObject(this, AttractorMine::_objectList); 53 55 54 56 this->toList(OM_GROUP_02); -
branches/new_class_id/src/world_entities/npcs/attractor_mine.h
r9235 r9709 9 9 10 10 class AttractorMine : public NPC { 11 NewObjectListDeclaration(AttractorMine); 11 12 12 13 public: -
branches/new_class_id/src/world_entities/npcs/door.cc
r9406 r9709 25 25 26 26 #include "door.h" 27 #include "class_list.h"28 27 29 30 31 32 33 CREATE_FACTORY(Door, CL_DOOR); 28 #include "class_id.h" 29 NewObjectListDefinitionID(Door, CL_DOOR); 30 CREATE_FACTORY(Door); 34 31 35 32 … … 47 44 Door::Door(const TiXmlElement* root) 48 45 { 49 50 this->setClassID(CL_DOOR, "Door"); 46 this->registerObject(this, Door::_objectList); 51 47 this->scale = 1.0f; 52 48 this->actionRadius = 1.0; … … 152 148 153 149 154 150 #include "playable.h" 151 #include "generic_npc.h" 155 152 /** 156 153 * checks if the door is open … … 159 156 { 160 157 161 std::list<BaseObject*>::const_iterator it;162 const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);163 158 WorldEntity* entity; 164 159 float distance; 165 160 166 if( list == NULL)167 return false;168 161 for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin(); 162 it != Playable::objectList().end(); 163 ++it) 169 164 // for all players 170 for( it = list->begin(); it != list->end(); it++)171 165 { 172 entity = dynamic_cast<WorldEntity*>(*it);166 entity = (*it); 173 167 174 168 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); … … 178 172 179 173 180 list = ClassList::getList(CL_GENERIC_NPC); 181 if( list == NULL)182 return false;183 for( it = list->begin(); it != list->end(); it++)174 175 for (NewObjectList<GenericNPC>::const_iterator it = GenericNPC::objectList().begin(); 176 it != GenericNPC::objectList().end(); 177 ++it) 184 178 { 185 entity = dynamic_cast<WorldEntity*>(*it);179 entity = (*it); 186 180 187 181 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); -
branches/new_class_id/src/world_entities/npcs/door.h
r9110 r9709 21 21 class Door : public WorldEntity 22 22 { 23 NewObjectListDeclaration(Door); 24 23 25 public: 24 26 Door(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/npcs/gate.cc
r9406 r9709 25 25 26 26 #include "gate.h" 27 #include "class_list.h"28 29 27 #include "effects/explosion.h" 30 28 … … 33 31 34 32 35 36 CREATE_FACTORY(Gate, CL_GATE); 33 #include "class_id.h" 34 NewObjectListDefinitionID(Gate, CL_GATE); 35 CREATE_FACTORY(Gate); 37 36 38 37 39 38 #include "script_class.h" 40 CREATE_SCRIPTABLE_CLASS(Gate, CL_GATE,39 CREATE_SCRIPTABLE_CLASS(Gate, Gate::classID(), 41 40 addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide)) 42 41 ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide)) 43 ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy)) 42 ->addMethod("destroy", ExecutorLua0<Gate>(&Gate::destroy)) 44 43 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 45 44 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) … … 49 48 50 49 50 51 51 //! list of all different animations a std md2model supports 52 52 sAnim Gate::animationList[3] = … … 62 62 Gate::Gate(const TiXmlElement* root) 63 63 { 64 65 this->setClassID(CL_GATE, "Gate"); 64 this->registerObject(this, Gate::_objectList); 66 65 this->scale = 1.0f; 67 66 this->actionRadius = 1.0; … … 165 164 void Gate::close() 166 165 { 167 166 168 167 if( this->destroyed) 169 168 return; 170 169 171 170 this->setAnimation(GATE_CLOSE, MD2_ANIM_ONCE); 172 171 this->bOpen = false; … … 178 177 if( this->destroyed) 179 178 return; 180 179 181 180 this->setAnimation(GATE_DIE, MD2_ANIM_ONCE); 182 181 183 182 Explosion::explode(this, Vector(this->getScaling()/160,this->getScaling()/160,this->getScaling()/160)); 184 185 183 184 186 185 this->destroyed = true; 187 186 } 188 187 188 #include "playable.h" 189 #include "generic_npc.h" 189 190 190 191 /** … … 195 196 196 197 std::list<BaseObject*>::const_iterator it; 197 const std::list<BaseObject*>* list = ClassList::getList(CL_PLAYABLE);198 198 WorldEntity* entity; 199 199 float distance; 200 200 201 if( list == NULL)202 return false;203 204 201 // for all players 205 for( it = list->begin(); it != list->end(); it++) 206 { 207 entity = dynamic_cast<WorldEntity*>(*it); 202 for (NewObjectList<Playable>::const_iterator it = Playable::objectList().begin(); 203 it != Playable::objectList().end(); 204 ++it) 205 { 206 entity = (*it); 208 207 209 208 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); … … 213 212 214 213 215 list = ClassList::getList(CL_GENERIC_NPC); 216 if( list == NULL) 217 return false; 218 for( it = list->begin(); it != list->end(); it++) 219 { 220 entity = dynamic_cast<WorldEntity*>(*it); 214 for (NewObjectList<GenericNPC>::const_iterator it = GenericNPC::objectList().begin(); 215 it != GenericNPC::objectList().end(); 216 ++it) 217 { 218 entity = (*it); 221 219 222 220 distance = fabs((this->getAbsCoor() - entity->getAbsCoor()).len()); -
branches/new_class_id/src/world_entities/npcs/gate.h
r9298 r9709 22 22 class Gate : public WorldEntity 23 23 { 24 NewObjectListDeclaration(Gate); 25 24 26 public: 25 27 Gate(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/npcs/generic_npc.cc
r9235 r9709 30 30 #include "loading/resource_manager.h" 31 31 32 33 CREATE_FACTORY(GenericNPC, CL_GENERIC_NPC); 32 #include "bsp_entity.h" 33 34 #include "class_id.h" 35 NewObjectListDefinitionID(GenericNPC, CL_GENERIC_NPC); 36 CREATE_FACTORY(GenericNPC); 34 37 35 38 #include "script_class.h" 36 CREATE_SCRIPTABLE_CLASS(GenericNPC, CL_GENERIC_NPC,39 CREATE_SCRIPTABLE_CLASS(GenericNPC, GenericNPC::classID(), 37 40 // Move 38 41 addMethod("walkTo", ExecutorLua3<GenericNPC,float,float,float>(&GenericNPC::walkTo)) … … 81 84 void GenericNPC::init() 82 85 { 83 this-> setClassID(CL_GENERIC_NPC, "GenericNPC");86 this->registerObject(this, GenericNPC::_objectList); 84 87 85 88 this->toList(OM_GROUP_00); … … 92 95 93 96 // collision reaction registration 94 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, CL_BSP_ENTITY);97 this->subscribeReaction(CREngine::CR_PHYSICS_GROUND_WALK, BspEntity::classID()); 95 98 } 96 99 -
branches/new_class_id/src/world_entities/npcs/generic_npc.h
r9235 r9709 25 25 class GenericNPC : public NPC 26 26 { 27 NewObjectListDeclaration(GenericNPC); 27 28 28 29 -
branches/new_class_id/src/world_entities/npcs/ground_turret.cc
r9707 r9709 29 29 #include "effects/explosion.h" 30 30 31 #include "class_id.h" 31 32 32 CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET); 33 34 33 NewObjectListDefinitionID(GroundTurret, CL_GROUND_TURRET); 34 CREATE_FACTORY(GroundTurret); 35 35 36 36 … … 62 62 void GroundTurret::init() 63 63 { 64 this-> setClassID(CL_GROUND_TURRET, "GroundTurret");64 this->registerObject(this, GroundTurret::_objectList); 65 65 this->loadModel("models/ground_turret_#.obj", 5); 66 66 this->left = NULL; -
branches/new_class_id/src/world_entities/npcs/ground_turret.h
r9656 r9709 14 14 class GroundTurret : public NPC 15 15 { 16 NewObjectListDeclaration(GroundTurret); 16 17 17 18 public: -
branches/new_class_id/src/world_entities/npcs/network_turret.cc
r9656 r9709 31 31 #include "weapons/aiming_turret.h" 32 32 33 CREATE_FACTORY(NetworkTurret, CL_NETWORK_TURRET); 34 35 33 #include "class_id.h" 34 NewObjectListDefinitionID(NetworkTurret, CL_NETWORK_TURRET); 35 CREATE_FACTORY(NetworkTurret); 36 36 37 37 … … 62 62 void NetworkTurret::init() 63 63 { 64 this-> setClassID(CL_NETWORK_TURRET, "NetworkTurret");64 this->registerObject(this, NetworkTurret::_objectList); 65 65 this->loadModel("models/ground_turret_#.obj", 5); 66 66 … … 111 111 ObjectManager::EntityList::iterator entity; 112 112 Vector diffVec; 113 for (entity = State::getObjectManager()->get ObjectList((OM_LIST)this->targetGroup).begin();114 entity != State::getObjectManager()->get ObjectList((OM_LIST)this->targetGroup).end();113 for (entity = State::getObjectManager()->getEntityList((OM_LIST)this->targetGroup).begin(); 114 entity != State::getObjectManager()->getEntityList((OM_LIST)this->targetGroup).end(); 115 115 entity ++) 116 116 { -
branches/new_class_id/src/world_entities/npcs/network_turret.h
r9656 r9709 14 14 class NetworkTurret : public NPC 15 15 { 16 16 NewObjectListDeclaration(NetworkTurret); 17 17 public: 18 18 NetworkTurret(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/npcs/npc_test.cc
r9707 r9709 31 31 32 32 #include "class_id.h" 33 CREATE_FACTORY(NPC2, CL_NPC_TEST2);34 33 NewObjectListDefinitionID(NPC2, CL_NPC_TEST2); 34 CREATE_FACTORY(NPC2); 35 35 36 36 NPC2::NPC2(const TiXmlElement* root) -
branches/new_class_id/src/world_entities/npcs/repair_station.cc
r9406 r9709 25 25 26 26 #include "repair_station.h" 27 #include "class_list.h"28 27 29 30 31 32 33 CREATE_FACTORY(RepairStation, CL_DOOR); 28 #include "class_id.h" 29 NewObjectListDefinitionID(RepairStation, CL_DOOR +1 ); 30 CREATE_FACTORY(RepairStation); 34 31 35 32 … … 67 64 RepairStation::RepairStation(const TiXmlElement* root) 68 65 { 69 70 this->setClassID(CL_DOOR, "RepairStation"); 66 this->registerObject(this, RepairStation::_objectList); 71 67 this->scale = 1.0f; 72 68 -
branches/new_class_id/src/world_entities/npcs/repair_station.h
r9003 r9709 27 27 class RepairStation : public WorldEntity 28 28 { 29 NewObjectListDeclaration(RepairStation); 29 30 public: 30 31 RepairStation (); -
branches/new_class_id/src/world_entities/npcs/space_turret.cc
r9656 r9709 29 29 #include "effects/explosion.h" 30 30 31 CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET); 31 #include "class_id.h" 32 NewObjectListDefinitionID(SpaceTurret, CL_SPACE_TURRET); 33 CREATE_FACTORY(SpaceTurret); 32 34 33 35 /** … … 59 61 void SpaceTurret::init() 60 62 { 61 this-> setClassID(CL_SPACE_TURRET, "SpaceTurret");63 this->registerObject(this, SpaceTurret::_objectList); 62 64 this->loadModel("models/ground_turret_#.obj", 7.5); 63 65 this->loadModel("models/comet.obj", 1.0f, 3); -
branches/new_class_id/src/world_entities/npcs/space_turret.h
r9656 r9709 18 18 class SpaceTurret : public NPC 19 19 { 20 NewObjectListDeclaration(SpaceTurret); 20 21 21 22 public: -
branches/new_class_id/src/world_entities/planet.cc
r9406 r9709 32 32 33 33 34 35 CREATE_FACTORY(Planet, CL_PLANET);36 34 #include "class_id.h" 35 NewObjectListDefinitionID(Planet, CL_PLANET); 36 CREATE_FACTORY(Planet); 37 37 38 38 … … 42 42 Planet::Planet(const TiXmlElement* root) 43 43 { 44 this-> setClassID(CL_PLANET, "Planet");44 this->registerObject(this, Planet::_objectList); 45 45 this->toList(OM_GROUP_01); 46 46 -
branches/new_class_id/src/world_entities/planet.h
r7221 r9709 16 16 class Planet : public WorldEntity 17 17 { 18 NewObjectListDeclaration(Planet); 19 18 20 public: 19 21 Planet(const TiXmlElement* root); -
branches/new_class_id/src/world_entities/power_ups/laser_power_up.cc
r9406 r9709 24 24 25 25 26 27 CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP); 26 #include "class_id.h" 27 NewObjectListDefinitionID(LaserPowerUp, CL_LASER_POWER_UP); 28 CREATE_FACTORY(LaserPowerUp); 28 29 29 30 LaserPowerUp::LaserPowerUp () : PowerUp(0.0, 1.0, 0.0) … … 49 50 void LaserPowerUp::init() 50 51 { 51 this-> setClassID(CL_LASER_POWER_UP, "LaserPowerUp");52 this->registerObject(this, LaserPowerUp::_objectList); 52 53 this->loadModel("models/guns/test_gun.obj", 2.0); 53 54 -
branches/new_class_id/src/world_entities/power_ups/laser_power_up.h
r7954 r9709 13 13 14 14 class LaserPowerUp : public PowerUp { 15 NewObjectListDeclaration(LaserPowerUp); 15 16 16 17 public: -
branches/new_class_id/src/world_entities/power_ups/param_power_up.cc
r9705 r9709 28 28 29 29 #include "class_id.h" 30 CREATE_FACTORY(ParamPowerUp, CL_PARAM_POWER_UP);31 30 NewObjectListDefinitionID(ParamPowerUp, CL_PARAM_POWER_UP); 31 CREATE_FACTORY(ParamPowerUp); 32 32 33 33 const char* ParamPowerUp::paramTypes[] = { -
branches/new_class_id/src/world_entities/power_ups/turret_power_up.cc
r9406 r9709 24 24 25 25 26 27 CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP); 26 #include "class_id.h" 27 NewObjectListDefinitionID(TurretPowerUp, CL_TURRET_POWER_UP); 28 CREATE_FACTORY(TurretPowerUp); 28 29 29 30 TurretPowerUp::TurretPowerUp(const TiXmlElement* root) : PowerUp(0.0, 1.0, 0.0) … … 45 46 void TurretPowerUp::init() 46 47 { 47 this-> setClassID(CL_TURRET_POWER_UP, "TurretPowerUp");48 this->registerObject(this, TurretPowerUp::_objectList); 48 49 this->loadModel("models/guns/turret1.obj", 2.0); 49 50 -
branches/new_class_id/src/world_entities/power_ups/turret_power_up.h
r7954 r9709 13 13 14 14 class TurretPowerUp : public PowerUp { 15 NewObjectListDeclaration(TurretPowerUp); 15 16 16 17 public: -
branches/new_class_id/src/world_entities/power_ups/weapon_power_up.cc
r9705 r9709 28 28 29 29 #include "class_id.h" 30 CREATE_FACTORY(WeaponPowerUp, CL_WEAPON_POWER_UP);31 30 NewObjectListDefinitionID(WeaponPowerUp, CL_WEAPON_POWER_UP); 31 CREATE_FACTORY(WeaponPowerUp); 32 32 33 33 WeaponPowerUp::WeaponPowerUp(const TiXmlElement* root) : PowerUp(1.0, 1.0, 0.0) … … 88 88 { 89 89 this->weapon = dynamic_cast<Weapon*>((weaponXML == NULL) 90 ? Factory::fabricate( static_cast<ClassID>(this->weapon->getLeafClassID()))90 ? Factory::fabricate((this->weapon->getClassID())) 91 91 : Factory::fabricate((const TiXmlElement*)this->getXmlElem()->FirstChildElement("weapon"))); 92 92 this->model = this->weapon->getModel(0); -
branches/new_class_id/src/world_entities/projectiles/bomb.cc
r8362 r9709 25 25 #include "debug.h" 26 26 27 CREATE_FAST_FACTORY_STATIC(Bomb, CL_BOMB); 27 #include "class_id.h" 28 NewObjectListDefinitionID(Bomb, CL_BOMB); 29 CREATE_FAST_FACTORY_STATIC(Bomb); 28 30 29 31 /** … … 67 69 void Bomb::init() 68 70 { 69 this-> setClassID(CL_BOMB, "Bomb");71 this->registerObject(this, Bomb::_objectList); 70 72 71 73 … … 173 175 } 174 176 177 175 178 void Bomb::deactivate() 176 179 { … … 182 185 void Bomb::detonate(float size) 183 186 { 184 ObjectManager::EntityList detonationList; 185 ObjectManager::distanceFromObject(detonationList, *this, size, CL_NPC); 187 /// FIXME 188 /* ObjectManager::EntityList detonationList; 189 ObjectManager::distanceFromObject(detonationList, *this, size, NPC::objectList()); 186 190 while( !detonationList.empty() ) 187 191 { 188 192 detonationList.front()->collidesWith(this, Vector(0,0,0)); 189 193 detonationList.pop_front(); 190 } 194 }*/ 191 195 } -
branches/new_class_id/src/world_entities/projectiles/bomb.h
r6622 r9709 17 17 class Bomb : public Projectile 18 18 { 19 19 NewObjectListDeclaration(Bomb); 20 20 public: 21 21 Bomb(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/projectiles/boomerang_projectile.cc
r9235 r9709 20 20 21 21 #include "state.h" 22 #include "class_list.h"23 22 24 23 #include "dot_emitter.h" … … 27 26 #include "debug.h" 28 27 29 CREATE_FAST_FACTORY_STATIC(BoomerangProjectile, CL_BOOMERANG_PROJECTILE); 28 #include "class_id.h" 29 NewObjectListDefinitionID(BoomerangProjectile, CL_BOOMERANG_PROJECTILE); 30 CREATE_FAST_FACTORY_STATIC(BoomerangProjectile); 30 31 31 32 /** … … 34 35 BoomerangProjectile::BoomerangProjectile () : Projectile() 35 36 { 36 this-> setClassID(CL_BOOMERANG_PROJECTILE, "BoomerangProjectile");37 this->registerObject(this, BoomerangProjectile::_objectList); 37 38 38 39 this->loadModel("models/projectiles/orx-rocket.obj", 2.0); … … 60 61 61 62 /* this is normaly done by World.cc by deleting the ParticleEngine */ 62 if (BoomerangProjectile::trailParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)63 { 64 if ( ClassList::exists(BoomerangProjectile::trailParticles, CL_PARTICLE_SYSTEM))63 if (BoomerangProjectile::trailParticles != NULL && BoomerangProjectile::objectList().size() <= 1) 64 { 65 if (ParticleSystem::objectList().exists(BoomerangProjectile::trailParticles)) 65 66 delete BoomerangProjectile::trailParticles; 66 67 BoomerangProjectile::trailParticles = NULL; 67 68 } 68 if (BoomerangProjectile::explosionParticles != NULL && ClassList::getList(CL_BOOMERANG_PROJECTILE)->size() <= 1)69 { 70 if ( ClassList::exists(BoomerangProjectile::explosionParticles, CL_PARTICLE_SYSTEM))69 if (BoomerangProjectile::explosionParticles != NULL && BoomerangProjectile::objectList().size() <= 1) 70 { 71 if (ParticleSystem::objectList().exists(BoomerangProjectile::explosionParticles)) 71 72 delete BoomerangProjectile::explosionParticles; 72 73 BoomerangProjectile::explosionParticles = NULL; -
branches/new_class_id/src/world_entities/projectiles/boomerang_projectile.h
r9235 r9709 17 17 class BoomerangProjectile : public Projectile 18 18 { 19 NewObjectListDeclaration(BoomerangProjectile); 19 20 public: 20 21 BoomerangProjectile (); -
branches/new_class_id/src/world_entities/projectiles/guided_missile.cc
r9298 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 23 22 #include "dot_emitter.h" … … 26 25 #include "debug.h" 27 26 28 CREATE_FAST_FACTORY_STATIC(GuidedMissile, CL_GUIDED_MISSILE); 27 #include "class_id.h" 28 NewObjectListDefinitionID(GuidedMissile, CL_GUIDED_MISSILE); 29 CREATE_FAST_FACTORY_STATIC(GuidedMissile); 29 30 30 31 /** … … 33 34 GuidedMissile::GuidedMissile () : Projectile() 34 35 { 35 this-> setClassID(CL_GUIDED_MISSILE, "GuidedMissile");36 this->registerObject(this, GuidedMissile::_objectList); 36 37 37 38 this->loadModel("models/projectiles/orx-rocket.obj", 2.0); … … 59 60 60 61 /* this is normaly done by World.cc by deleting the ParticleEngine */ 61 if (GuidedMissile::trailParticles != NULL && ClassList::getList(CL_GUIDED_MISSILE)->size() <= 1)62 { 63 if ( ClassList::exists(GuidedMissile::trailParticles, CL_PARTICLE_SYSTEM))62 if (GuidedMissile::trailParticles != NULL && GuidedMissile::objectList().size() <= 1) 63 { 64 if (ParticleSystem::objectList().exists(GuidedMissile::trailParticles)) 64 65 delete GuidedMissile::trailParticles; 65 66 GuidedMissile::trailParticles = NULL; 66 67 } 67 if (GuidedMissile::explosionParticles != NULL && ClassList::getList(CL_GUIDED_MISSILE)->size() <= 1)68 { 69 if ( ClassList::exists(GuidedMissile::explosionParticles, CL_PARTICLE_SYSTEM))68 if (GuidedMissile::explosionParticles != NULL && GuidedMissile::objectList().size() <= 1) 69 { 70 if (ParticleSystem::objectList().exists(GuidedMissile::explosionParticles)) 70 71 delete GuidedMissile::explosionParticles; 71 72 GuidedMissile::explosionParticles = NULL; -
branches/new_class_id/src/world_entities/projectiles/guided_missile.h
r9656 r9709 16 16 class GuidedMissile : public Projectile 17 17 { 18 NewObjectListDeclaration(GuidedMissile); 18 19 public: 19 20 GuidedMissile (); -
branches/new_class_id/src/world_entities/projectiles/hyperblast.cc
r9235 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 23 22 #include "box_emitter.h" … … 26 25 #include "debug.h" 27 26 28 CREATE_FAST_FACTORY_STATIC(Hyperblast, CL_HYPERBLAST); 27 #include "class_id.h" 28 NewObjectListDefinitionID(Hyperblast, CL_HYPERBLAST); 29 CREATE_FAST_FACTORY_STATIC(Hyperblast); 30 29 31 30 32 /** … … 33 35 Hyperblast::Hyperblast () : Projectile() 34 36 { 35 this-> setClassID(CL_HYPERBLAST, "Hyperblast");37 this->registerObject(this, Hyperblast::_objectList); 36 38 37 39 this->loadModel("models/projectiles/hyperblast.obj", 5); … … 55 57 { 56 58 /* this is normaly done by World.cc by deleting the ParticleEngine */ 57 if (Hyperblast::explosionParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)59 if (Hyperblast::explosionParticles != NULL && Hyperblast::objectList().size() <= 1) 58 60 { 59 61 Hyperblast::explosionParticles = NULL; -
branches/new_class_id/src/world_entities/projectiles/hyperblast.h
r9235 r9709 17 17 class Hyperblast : public Projectile 18 18 { 19 NewObjectListDeclaration(Hyperblast); 19 20 public: 20 21 Hyperblast (); -
branches/new_class_id/src/world_entities/projectiles/laser.cc
r9656 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 #include "model.h" 23 22 … … 29 28 30 29 31 32 CREATE_FAST_FACTORY_STATIC(Laser, CL_LASER); 30 #include "class_id.h" 31 NewObjectListDefinition(Laser); 32 CREATE_FAST_FACTORY_STATIC(Laser); 33 33 34 34 /** … … 37 37 Laser::Laser () : Projectile() 38 38 { 39 this-> setClassID(CL_LASER, "Laser");39 this->registerObject(this, Laser::_objectList); 40 40 41 41 this->loadModel("models/projectiles/laser.obj"); … … 61 61 62 62 /* this is normaly done by World.cc by deleting the ParticleEngine */ 63 if (Laser::explosionParticles != NULL && ClassList::getList(CL_LASER)->size() <= 1)63 if (Laser::explosionParticles != NULL && Laser::objectList().size() <= 1) 64 64 { 65 65 //if (ClassList::exists(Laser::explosionParticles, CL_PARTICLE_SYSTEM)) -
branches/new_class_id/src/world_entities/projectiles/laser.h
r9235 r9709 17 17 class Laser : public Projectile 18 18 { 19 NewObjectListDeclaration(Laser); 19 20 public: 20 21 Laser (); -
branches/new_class_id/src/world_entities/projectiles/projectile.h
r9705 r9709 11 11 12 12 #include "world_entity.h" 13 #include " fast_factory.h"13 #include "loading/fast_factory.h" 14 14 15 15 #include "sound_source.h" -
branches/new_class_id/src/world_entities/projectiles/rail_projectile.cc
r9406 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 #include "model.h" 23 22 … … 29 28 30 29 31 32 CREATE_FAST_FACTORY_STATIC(RailProjectile, CL_RAIL_PROJECTILE); 30 #include "class_id.h" 31 NewObjectListDefinitionID(RailProjectile, CL_RAIL_PROJECTILE); 32 CREATE_FAST_FACTORY_STATIC(RailProjectile); 33 33 34 34 /** … … 37 37 RailProjectile::RailProjectile () : Projectile() 38 38 { 39 this-> setClassID(CL_RAIL_PROJECTILE, "RailProjectile");39 this->registerObject(this, RailProjectile::_objectList); 40 40 41 41 this->loadModel("models/projectiles/laser_projectile.obj", 100); … … 61 61 62 62 /* this is normaly done by World.cc by deleting the ParticleEngine */ 63 if (RailProjectile::explosionParticles != NULL && ClassList::getList(CL_RAIL_PROJECTILE)->size() <= 1)63 if (RailProjectile::explosionParticles != NULL && RailProjectile::objectList().size() <= 1) 64 64 { 65 65 //if (ClassList::exists(RailProjectile::explosionParticles, CL_PARTICLE_SYSTEM)) -
branches/new_class_id/src/world_entities/projectiles/rail_projectile.h
r9235 r9709 17 17 class RailProjectile : public Projectile 18 18 { 19 NewObjectListDeclaration(RailProjectile); 19 20 public: 20 21 RailProjectile (); -
branches/new_class_id/src/world_entities/projectiles/rocket.cc
r9235 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 23 22 #include "dot_emitter.h" … … 26 25 #include "debug.h" 27 26 28 CREATE_FAST_FACTORY_STATIC(Rocket, CL_ROCKET); 27 #include "class_id.h" 28 NewObjectListDefinitionID(Rocket, CL_ROCKET); 29 CREATE_FAST_FACTORY_STATIC(Rocket); 29 30 30 31 /** … … 33 34 Rocket::Rocket () : Projectile() 34 35 { 35 this-> setClassID(CL_ROCKET, "Rocket");36 this->registerObject(this, Rocket::_objectList); 36 37 37 38 this->loadModel("models/projectiles/orx-rocket.obj", .3); … … 55 56 56 57 /* this is normaly done by World.cc by deleting the ParticleEngine */ 57 if (Rocket::trailParticles != NULL && ClassList::getList(CL_ROCKET)->size() <= 1)58 if (Rocket::trailParticles != NULL && Rocket::objectList().size() <= 1) 58 59 { 59 60 /* if (ClassList::exists(Rocket::trailParticles, CL_PARTICLE_SYSTEM)) … … 61 62 Rocket::trailParticles = NULL; 62 63 } 63 if (Rocket::explosionParticles != NULL && ClassList::getList(CL_ROCKET)->size() <= 1)64 if (Rocket::explosionParticles != NULL && Rocket::objectList().size() <= 1) 64 65 { 65 66 /* if (ClassList::exists(Rocket::explosionParticles, CL_PARTICLE_SYSTEM)) -
branches/new_class_id/src/world_entities/projectiles/rocket.h
r9235 r9709 9 9 #include "projectile.h" 10 10 11 class Vector;12 class Weapon;13 11 class SpriteParticles; 14 12 class ParticleEmitter; … … 17 15 class Rocket : public Projectile 18 16 { 19 public: 20 Rocket (); 21 virtual ~Rocket (); 17 NewObjectListDeclaration(Rocket); 18 19 public: 20 Rocket (); 21 virtual ~Rocket (); 22 22 23 23 24 25 24 virtual void activate(); 25 virtual void deactivate(); 26 26 27 27 virtual void collidesWith(WorldEntity* entity, const Vector& location); 28 28 29 29 virtual void destroy (WorldEntity* killer); 30 30 31 32 31 virtual void tick (float time); 32 virtual void draw () const; 33 33 34 34 35 36 37 38 35 private: 36 static FastFactory* fastFactory; 37 static SpriteParticles* trailParticles; 38 static SpriteParticles* explosionParticles; 39 39 40 40 ParticleEmitter* emitter; 41 41 42 42 43 43 WorldEntity* hitEntity; // FIXME TEMPORARY 44 44 45 45 }; -
branches/new_class_id/src/world_entities/projectiles/test_bullet.cc
r9235 r9709 19 19 20 20 #include "state.h" 21 #include "class_list.h"22 21 23 22 #include "dot_emitter.h" … … 25 24 #include "debug.h" 26 25 27 CREATE_FAST_FACTORY_STATIC(TestBullet, CL_TEST_BULLET); 26 #include "class_id.h" 27 NewObjectListDefinitionID(TestBullet, CL_TEST_BULLET); 28 CREATE_FAST_FACTORY_STATIC(TestBullet); 28 29 29 30 /** … … 32 33 TestBullet::TestBullet () : Projectile() 33 34 { 34 this-> setClassID(CL_TEST_BULLET, "TestBullet");35 this->registerObject(this, TestBullet::_objectList); 35 36 36 37 this->loadModel("models/projectiles/orx-rocket.obj", .3); … … 54 55 55 56 /* this is normaly done by World.cc by deleting the ParticleEngine */ 56 if (TestBullet::trailParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)57 if (TestBullet::trailParticles != NULL && TestBullet::objectList().size() <= 1) 57 58 { 58 if ( ClassList::exists(TestBullet::trailParticles, CL_PARTICLE_SYSTEM))59 if (ParticleSystem::objectList().exists(TestBullet::trailParticles)) 59 60 delete TestBullet::trailParticles; 60 61 TestBullet::trailParticles = NULL; 61 62 } 62 if (TestBullet::explosionParticles != NULL && ClassList::getList(CL_TEST_BULLET)->size() <= 1)63 if (TestBullet::explosionParticles != NULL && TestBullet::objectList().size() <= 1) 63 64 { 64 if ( ClassList::exists(TestBullet::explosionParticles, CL_PARTICLE_SYSTEM))65 if (ParticleSystem::objectList().exists(TestBullet::explosionParticles)) 65 66 delete TestBullet::explosionParticles; 66 67 TestBullet::explosionParticles = NULL; -
branches/new_class_id/src/world_entities/projectiles/test_bullet.h
r9235 r9709 17 17 class TestBullet : public Projectile 18 18 { 19 NewObjectListDeclaration(TestBullet); 20 19 21 public: 20 22 TestBullet (); -
branches/new_class_id/src/world_entities/recorder.cc
r9406 r9709 22 22 23 23 24 25 CREATE_FACTORY(Recorder, CL_RECORDER); 24 #include "class_id.h" 25 NewObjectListDefinitionID(Recorder, CL_RECORDER); 26 CREATE_FACTORY(Recorder); 26 27 27 28 28 29 Recorder::Recorder (const TiXmlElement* root) 29 30 { 30 this-> setClassID(CL_RECORDER, "Recorder");31 this->registerObject(this, Recorder::_objectList); 31 32 32 33 // initialize libavcodec, and register all codecs and formats -
branches/new_class_id/src/world_entities/recorder.h
r7221 r9709 20 20 class Recorder : public WorldEntity 21 21 { 22 NewObjectListDeclaration(Recorder); 22 23 public: 23 24 Recorder (const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/satellite.cc
r9406 r9709 21 21 22 22 #include "objModel.h" 23 #include "vector.h"24 23 25 24 26 25 26 27 NewObjectListDefinition(Satellite); 27 28 28 29 /** … … 31 32 Satellite::Satellite (Vector axis, float speed) 32 33 { 33 this-> setClassID(CL_SATELLITE, "Satellite");34 this->registerObject(this, Satellite::_objectList); 34 35 35 36 this->loadModel("cube"); -
branches/new_class_id/src/world_entities/satellite.h
r7193 r9709 19 19 class Satellite : public WorldEntity 20 20 { 21 friend class World;21 NewObjectListDeclaration(Satellite); 22 22 23 23 public: -
branches/new_class_id/src/world_entities/script_trigger.cc
r9656 r9709 16 16 17 17 #include "script_trigger.h" 18 #include "class_list.h"19 18 #include "script.h" 20 19 21 20 #include "state.h" 22 21 23 24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, CL_SCRIPT_TRIGGER, 22 NewObjectListDefinition(ScriptTrigger); 23 24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, ScriptTrigger::classID(), 25 25 // Coordinates 26 26 addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) … … 49 49 */ 50 50 ScriptTrigger::ScriptTrigger(const TiXmlElement* root) 51 { 52 this-> setClassID(CL_SCRIPT_TRIGGER, "ScriptTrigger");51 { 52 this->registerObject(this, ScriptTrigger::_objectList); 53 53 this->toList(OM_COMMON); 54 54 … … 139 139 void ScriptTrigger::setTarget(const std::string& target) 140 140 { 141 BaseObject* targetEntity = ClassList::getObject(target, CL_WORLD_ENTITY); 142 141 142 WorldEntity* targetEntity = WorldEntity::objectList().getObject(target); 143 143 if (targetEntity != NULL) 144 144 { 145 this->setTarget( dynamic_cast<WorldEntity*>(targetEntity));145 this->setTarget(targetEntity); 146 146 } 147 147 else … … 157 157 void ScriptTrigger::setTriggerParent(const std::string& parent) 158 158 { 159 BaseObject* parentEntity = ClassList::getObject(parent, CL_WORLD_ENTITY);159 WorldEntity* parentEntity = WorldEntity::objectList().getObject(parent); 160 160 161 161 if (parentEntity != NULL) 162 162 { 163 this->setParent( dynamic_cast<WorldEntity*>(parentEntity));163 this->setParent(parentEntity); 164 164 this->setParentMode(PNODE_MOVEMENT); 165 165 } -
branches/new_class_id/src/world_entities/script_trigger.h
r9298 r9709 18 18 class ScriptTrigger : public WorldEntity 19 19 { 20 NewObjectListDeclaration(ScriptTrigger); 20 21 public: 21 22 ScriptTrigger(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/skybox.cc
r9656 r9709 31 31 32 32 33 34 CREATE_FACTORY(SkyBox, CL_SKYBOX); 33 #include "class_id.h" 34 NewObjectListDefinitionID(SkyBox, CL_SKYBOX); 35 CREATE_FACTORY(SkyBox); 35 36 36 37 /** … … 72 73 void SkyBox::preInit() 73 74 { 74 this-> setClassID(CL_SKYBOX, "SkyBox");75 this->registerObject(this, SkyBox::_objectList); 75 76 this->toList(OM_BACKGROUND); 76 77 this->toReflectionList(); -
branches/new_class_id/src/world_entities/skybox.h
r8619 r9709 27 27 class SkyBox : public WorldEntity 28 28 { 29 public: 29 NewObjectListDeclaration(SkyBox); 30 public: 30 31 SkyBox(const std::string& fileName = ""); 31 32 SkyBox(const TiXmlElement* root); -
branches/new_class_id/src/world_entities/skydome.cc
r9406 r9709 30 30 31 31 32 NewObjectListDefinition(Skydome); 32 33 33 34 /** … … 44 45 PRINTF(0)("Skydome init\n"); 45 46 46 this-> setClassID(CL_SKYDOME, "Skydome");47 this->registerObject(this, Skydome::_objectList); 47 48 this->toList(OM_BACKGROUND); 48 49 this->toReflectionList(); … … 119 120 glEnd(); 120 121 121 WorldEntity::draw(); 122 WorldEntity::draw(); 122 123 123 124 glPopMatrix(); -
branches/new_class_id/src/world_entities/skydome.h
r9006 r9709 21 21 class Skydome : public WorldEntity 22 22 { 23 NewObjectListDeclaration(Skydome); 23 24 public: 24 25 Skydome(); … … 31 32 void generateSkyPlane(int divisions, float planetRadius, float atmosphereRadius, 32 33 float hTile, float vTile); 33 34 34 35 void setShader(Shader* shader); 35 36 void setTexture(GLuint texture); 36 37 37 38 void activate(); 38 39 void deactivate(); 39 40 40 41 private: 41 42 42 43 typedef struct VertexInfo 43 44 { … … 48 49 49 50 bool activateDome; 50 51 51 52 VertexInfo *planeVertices; 52 53 int numPlaneVertices; … … 59 60 VertexInfo *vertices; 60 61 int numVertices; 61 62 62 63 GLuint texture; 63 64 Shader* shader; -
branches/new_class_id/src/world_entities/skysphere.cc
r9406 r9709 27 27 28 28 #include "skysphere.h" 29 #include "stdincl.h"30 29 31 30 #include "material.h" … … 33 32 34 33 35 34 NewObjectListDefinition(Skysphere); 36 35 37 36 /** … … 41 40 Skysphere::Skysphere(char* fileName) 42 41 { 43 this-> setClassID(CL_SKYSPHERE, "SkySphere");42 this->registerObject(this, Skysphere::_objectList); 44 43 this->toList(OM_BACKGROUND); 45 44 if (fileName == NULL) -
branches/new_class_id/src/world_entities/skysphere.h
r7076 r9709 24 24 class Skysphere : public WorldEntity 25 25 { 26 NewObjectListDeclaration(Skysphere); 26 27 27 28 public: -
branches/new_class_id/src/world_entities/space_ships/collision_probe.cc
r9406 r9709 24 24 25 25 26 #include "class_id.h" 27 NewObjectListDefinitionID(CollisionProbe, CL_COLLISION_PROBE); 26 28 27 28 CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE); 29 CREATE_FACTORY(CollisionProbe); 29 30 30 31 … … 56 57 void CollisionProbe::init() 57 58 { 58 this-> setClassID(CL_COLLISION_PROBE, "CollisionProbe");59 this->registerObject(this, CollisionProbe::_objectList); 59 60 60 61 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; -
branches/new_class_id/src/world_entities/space_ships/collision_probe.h
r8490 r9709 13 13 class CollisionProbe : public Playable 14 14 { 15 NewObjectListDeclaration(CollisionProbe); 15 16 16 17 public: -
branches/new_class_id/src/world_entities/space_ships/cruizer.cc
r9235 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Cruizer, CL_CRUIZER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Cruizer, CL_CRUIZER); 38 CREATE_FACTORY(Cruizer); 37 39 38 40 /** … … 89 91 { 90 92 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 91 this-> setClassID(CL_CRUIZER, "Cruizer");93 this->registerObject(this, Cruizer::_objectList); 92 94 93 95 this->setSupportedPlaymodes(Playable::Full3D); -
branches/new_class_id/src/world_entities/space_ships/cruizer.h
r9061 r9709 16 16 class Cruizer : public Playable 17 17 { 18 NewObjectListDeclaration(Cruizer); 18 19 public: 19 20 Cruizer(const std::string& fileName); -
branches/new_class_id/src/world_entities/space_ships/helicopter.cc
r9235 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Helicopter, CL_HELICOPTER); 38 CREATE_FACTORY(Helicopter); 37 39 #include "script_class.h" 38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,40 CREATE_SCRIPTABLE_CLASS(Helicopter, Helicopter::classID(), 39 41 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp)) 40 42 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown)) … … 46 48 ); 47 49 50 48 51 /** 49 52 * creates the controlable Helicopter … … 100 103 Weapon* wpLeft = new TestGun(1); 101 104 wpLeft->setName("testGun Left"); 102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_CANNON));105 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon")); 103 106 104 107 cannon->setName("BFG"); … … 126 129 this->chopperBuffer = NULL; 127 130 128 this-> setClassID(CL_HELICOPTER, "Helicopter");131 this->registerObject(this, Helicopter::_objectList); 129 132 PRINTF(4)("HELICOPTER INIT\n"); 130 133 -
branches/new_class_id/src/world_entities/space_ships/helicopter.h
r9235 r9709 17 17 class Helicopter : public Playable 18 18 { 19 NewObjectListDeclaration(Helicopter); 19 20 20 21 public: -
branches/new_class_id/src/world_entities/space_ships/hover.cc
r9656 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Hover, CL_HOVER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Hover, CL_HOVER); 38 CREATE_FACTORY(Hover); 37 39 38 40 #include "script_class.h" 39 CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,41 CREATE_SCRIPTABLE_CLASS(Hover, Hover::classID(), 40 42 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 41 43 //Coordinates … … 98 100 Weapon* wpLeft = new TestGun(1); 99 101 wpLeft->setName("testGun Left"); 100 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_HYPERBLASTER));102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Hyperblaster")); 101 103 102 104 cannon->setName("BFG"); … … 123 125 124 126 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 125 this-> setClassID(CL_HOVER, "Hover");127 this->registerObject(this, Hover::_objectList); 126 128 this->toReflectionList(); 127 129 -
branches/new_class_id/src/world_entities/space_ships/hover.h
r9235 r9709 15 15 class Hover : public Playable 16 16 { 17 NewObjectListDeclaration(Hover); 17 18 public: 18 19 -
branches/new_class_id/src/world_entities/space_ships/space_ship.cc
r9656 r9709 53 53 54 54 55 56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP); 55 #include "class_id.h" 56 NewObjectListDefinitionID(SpaceShip, CL_SPACE_SHIP); 57 CREATE_FACTORY(SpaceShip); 58 57 59 #include "script_class.h" 58 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,60 CREATE_SCRIPTABLE_CLASS(SpaceShip, SpaceShip::classID(), 59 61 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 60 62 ->addMethod("fire", ExecutorLua1<Playable, bool>(&Playable::fire)) … … 117 119 { 118 120 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 119 this-> setClassID(CL_SPACE_SHIP, "SpaceShip");121 this->registerObject(this, SpaceShip::_objectList); 120 122 121 123 PRINTF(4)("SPACESHIP INIT\n"); -
branches/new_class_id/src/world_entities/space_ships/space_ship.h
r9235 r9709 19 19 class SpaceShip : public Playable 20 20 { 21 NewObjectListDeclaration(SpaceShip); 21 22 22 23 public: … … 36 37 virtual void postSpawn(); 37 38 virtual void leftWorld(); 38 39 39 40 virtual void destroy(WorldEntity* killer); 40 41 virtual void respawn(); -
branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.cc
r9406 r9709 38 38 39 39 40 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D); 41 42 43 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D, 40 #include "class_id.h" 41 NewObjectListDefinitionID(Spacecraft2D, CL_SPACECRAFT_2D); 42 CREATE_FACTORY(Spacecraft2D); 43 44 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, Spacecraft2D::classID(), 44 45 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 45 46 //Coordinates … … 52 53 53 54 55 54 56 /** 55 57 * @brief loads a Spacecraft2D information from a specified file. … … 85 87 86 88 //weapons: 87 Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate( CL_LASER_CANNON));89 Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon")); 88 90 wpRight->setName("Cannon_Right"); 89 Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate( CL_LASER_CANNON));91 Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon")); 90 92 wpLeft->setName("Cannon_Left"); 91 93 92 Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate( CL_BOOMERANG_GUN));94 Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun")); 93 95 wpRight->setName("Turret_Left"); 94 Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate( CL_BOOMERANG_GUN));96 Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun")); 95 97 wpLeft->setName("Turret_Right"); 96 98 … … 125 127 { 126 128 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 127 this-> setClassID(CL_SPACECRAFT_2D, "Spacecraft2D");129 this->registerObject(this, Spacecraft2D::_objectList); 128 130 129 131 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal ); -
branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.h
r9235 r9709 16 16 class Spacecraft2D : public Playable 17 17 { 18 NewObjectListDeclaration(Spacecraft2D); 18 19 public: 19 20 Spacecraft2D(const std::string& fileName); -
branches/new_class_id/src/world_entities/space_ships/turbine_hover.cc
r9656 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(TurbineHover, CL_TURBINE_HOVER); 38 CREATE_FACTORY(TurbineHover); 37 39 38 40 /** … … 101 103 { 102 104 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 103 this-> setClassID(CL_TURBINE_HOVER, "TurbineHover");105 this->registerObject(this, TurbineHover::_objectList); 104 106 105 107 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); -
branches/new_class_id/src/world_entities/space_ships/turbine_hover.h
r9656 r9709 18 18 class TurbineHover : public Playable 19 19 { 20 public: 21 TurbineHover(const std::string& fileName); 22 TurbineHover(const TiXmlElement* root = NULL); 23 virtual ~TurbineHover(); 20 NewObjectListDeclaration(TurbineHover); 21 public: 22 TurbineHover(const std::string& fileName); 23 TurbineHover(const TiXmlElement* root = NULL); 24 virtual ~TurbineHover(); 24 25 25 26 void setBoostColor(const Color& color); 26 27 27 28 29 30 28 virtual void loadParams(const TiXmlElement* root); 29 virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); 30 virtual void enter(); 31 virtual void leave(); 31 32 32 33 virtual void setTeam(int teamID); 33 34 34 35 36 35 virtual void postSpawn(); 36 virtual void leftWorld(); 37 virtual void respawn(); 37 38 38 39 40 39 virtual void collidesWith(WorldEntity* entity, const Vector& location); 40 virtual void tick(float dt); 41 virtual void draw() const; 41 42 42 43 virtual void process(const Event &event); 43 44 44 45 46 45 private: 46 void init(); 47 void movement(float dt); 47 48 48 49 50 51 52 53 54 49 private: 50 bool bForward; //!< forward button pressed. 51 bool bBackward; //!< backward button pressed. 52 bool bLeft; //!< left button pressed. 53 bool bRight; //!< right button pressed. 54 bool bAscend; //!< ascend button pressed. 55 bool bDescend; //!< descend button presses. 55 56 56 57 57 int yInvert; 58 float mouseSensitivity; //!< the mouse sensitivity 58 59 59 60 61 62 60 PNode wingNodeLeft; 61 PNode wingNodeRight; 62 PNode rotorNodeLeft; 63 PNode rotorNodeRight; 63 64 64 65 66 65 PNode cameraNode; 66 float cameraLook; 67 float rotation; 67 68 68 69 70 71 72 69 // Vector velocity; //!< the velocity of the TurbineHover. 70 Quaternion direction; //!< the direction of the TurbineHover. 71 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 72 float acceleration; //!< the acceleration of the TurbineHover. 73 float airFriction; //!< AirFriction. 73 74 74 75 75 float rotorSpeed; //!< the speed of the rotor. 76 float rotorCycle; //!< The Cycle the rotor is in. 76 77 77 78 float airViscosity; 78 79 79 80 80 ParticleEmitter* burstEmitter[2]; 81 ParticleSystem* burstSystem; 81 82 }; 82 83 -
branches/new_class_id/src/world_entities/spawning_point.cc
r9706 r9709 34 34 35 35 #include "class_id.h" 36 CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );37 36 NewObjectListDefinitionID(SpawningPoint, CL_SPAWNING_POINT); 37 CREATE_FACTORY( SpawningPoint); 38 38 /** 39 39 * constructor -
branches/new_class_id/src/world_entities/spectator.cc
r9406 r9709 22 22 #include "shared_network_data.h" 23 23 24 CREATE_FACTORY(Spectator, CL_SPECTATOR); 25 26 27 24 #include "class_id.h" 25 NewObjectListDefinitionID(Spectator, CL_SPECTATOR); 26 CREATE_FACTORY(Spectator); 28 27 29 28 … … 58 57 { 59 58 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 60 this-> setClassID(CL_SPECTATOR, "Spectator");59 this->registerObject(this, Spectator::_objectList); 61 60 62 61 this->getWeaponManager().changeWeaponConfig(1); … … 89 88 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 90 89 91 90 92 91 registerVar( new SynchronizeableBool( &bLeft, &bLeft, "bLeft", PERMISSION_OWNER ) ); 93 92 registerVar( new SynchronizeableBool( &bRight, &bRight, "bRight", PERMISSION_OWNER ) ); … … 161 160 { 162 161 Playable::tick( time ); 163 162 164 163 if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() ) 165 164 { 166 165 xMouse *= time / 10; 167 166 yMouse *= time / 10; 168 167 169 168 angleX -= xMouse; 170 169 angleY -= yMouse; 171 170 172 171 if ( angleY > 2.05 ) 173 172 angleY = 2.05; 174 173 175 174 if ( angleY < -1.15 ) 176 175 angleY = -1.15; 177 176 178 177 this->mouseDir = Quaternion( angleX, Vector( 0, 1, 0 ) ) * Quaternion( angleY, Vector( 0, 0, 1 ) ); 179 178 180 179 xMouse = yMouse = 0; 181 180 } 182 181 183 182 this->setAbsDir( this->mouseDir ); 184 183 185 184 Vector velocity; 186 185 187 186 if ( this->bForward ) 188 187 { 189 188 velocity += this->getAbsDirX(); 190 189 } 191 190 192 191 if ( this->bBackward ) 193 192 { 194 193 velocity -= this->getAbsDirX(); 195 194 } 196 195 197 196 if ( this->bRight ) 198 197 { 199 198 velocity += this->getAbsDirZ(); 200 199 } 201 200 202 201 if ( this->bLeft ) 203 202 { 204 203 velocity -= this->getAbsDirZ(); 205 204 } 206 205 207 206 velocity *= 100; 208 207 209 208 this->shiftCoor( velocity*time ); 210 209 } -
branches/new_class_id/src/world_entities/spectator.h
r8228 r9709 11 11 class Spectator : public Playable 12 12 { 13 NewObjectListDeclaration(Spectator); 13 14 14 15 public: … … 37 38 bool bForward; 38 39 bool bBackward; 39 40 40 41 float xMouse; //!< mouse moved in x-Direction 41 42 float yMouse; //!< mouse moved in y-Direction -
branches/new_class_id/src/world_entities/terrain.cc
r9406 r9709 34 34 35 35 36 37 CREATE_FACTORY(Terrain, CL_TERRAIN); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Terrain, CL_TERRAIN); 38 CREATE_FACTORY(Terrain); 38 39 39 40 /** … … 89 90 { 90 91 if (objectList) 91 glDeleteLists(this-> objectList, 1);92 glDeleteLists(this->modelList, 1); 92 93 if( this->ssp) 93 94 delete ssp; … … 104 105 void Terrain::init() 105 106 { 106 this-> setClassID(CL_TERRAIN, "Terrain");107 this->registerObject(this, Terrain::_objectList); 107 108 this->toList(OM_ENVIRON_NOTICK); 108 109 this->toReflectionList(); 109 110 110 this-> objectList = 0;111 this->modelList = 0; 111 112 this->ssp = NULL; 112 113 this->vegetation = NULL; … … 207 208 208 209 if (this->objectList) 209 glCallList(this-> objectList);210 glCallList(this->modelList); 210 211 else if (this->getModel()) 211 212 this->getModel()->draw(); … … 256 257 if (debugTerrain == TERRAIN_DAVE) 257 258 { 258 objectList = glGenLists(1);259 glNewList ( objectList, GL_COMPILE);259 modelList = glGenLists(1); 260 glNewList (modelList, GL_COMPILE); 260 261 261 262 glColor3f(1.0,0,0); -
branches/new_class_id/src/world_entities/terrain.h
r7954 r9709 12 12 13 13 #include "world_entity.h" 14 #include "vector.h"15 14 16 15 // FORWARD DECLARATION … … 26 25 class Terrain : public WorldEntity 27 26 { 27 NewObjectListDeclaration(Terrain); 28 28 29 29 public: … … 52 52 private: 53 53 Model* vegetation; 54 int objectList;54 int modelList; 55 55 56 56 HeightMap* heightMap; -
branches/new_class_id/src/world_entities/test_entity.cc
r9406 r9709 35 35 36 36 37 38 CREATE_FACTORY(TestEntity, CL_TEST_ENTITY); 37 #include "class_id.h" 38 NewObjectListDefinition(TestEntity); 39 CREATE_FACTORY(TestEntity); 39 40 40 41 #include "script_class.h" 41 CREATE_SCRIPTABLE_CLASS(TestEntity, CL_TEST_ENTITY,42 CREATE_SCRIPTABLE_CLASS(TestEntity, TestEntity::classID(), 42 43 addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 43 44 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) 44 45 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY)) 45 46 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ)) 46 47 47 48 ); 48 49 … … 75 76 void TestEntity::init() 76 77 { 77 this-> setClassID(CL_TEST_ENTITY, "TestEntity");78 this->registerObject(this, TestEntity::_objectList); 78 79 this->toList(OM_GROUP_00); 79 80 -
branches/new_class_id/src/world_entities/test_entity.h
r9235 r9709 15 15 class TestEntity : public WorldEntity, public PhysicsInterface 16 16 { 17 NewObjectListDeclaration(TestEntity); 17 18 public: 18 19 TestEntity (); -
branches/new_class_id/src/world_entities/weapons/aim.cc
r9656 r9709 29 29 30 30 31 NewObjectListDefinition(Aim); 31 32 32 33 /** … … 59 60 void Aim::init() 60 61 { 61 this-> setClassID(CL_CROSSHAIR, "Aim");62 this->registerObject(this, Aim::_objectList); 62 63 this->setName("Aim"); 63 64 … … 107 108 ObjectManager::EntityList::iterator entity; 108 109 //printf("%d\n", this->targetGroup); 109 for (entity = State::getObjectManager()->get ObjectList(this->targetGroup).begin();110 entity != State::getObjectManager()->get ObjectList(this->targetGroup).end();110 for (entity = State::getObjectManager()->getEntityList(this->targetGroup).begin(); 111 entity != State::getObjectManager()->getEntityList(this->targetGroup).end(); 111 112 entity ++) 112 113 { -
branches/new_class_id/src/world_entities/weapons/aim.h
r9656 r9709 19 19 template<class T> class tAnimation; 20 20 21 21 22 //! An Aim for zooming in on Targets. 22 23 /** … … 28 29 class Aim : public PNode, public Element2D 29 30 { 31 NewObjectListDeclaration(Aim); 30 32 31 33 public: -
branches/new_class_id/src/world_entities/weapons/aiming_system.cc
r9406 r9709 30 30 31 31 32 NewObjectListDefinition(AimingSystem); 32 33 33 34 /** … … 55 56 void AimingSystem::init() 56 57 { 57 this-> setClassID(CL_AIMING_SYSTEM, "AimingSystem");58 this->registerObject(this, AimingSystem::_objectList); 58 59 this->setName("AimingSystem"); 59 60 … … 63 64 // registering default reactions: 64 65 this->unsubscribeReaction(CREngine::CR_OBJECT_DAMAGE); 65 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, CL_WORLD_ENTITY);66 this->subscribeReaction(CREngine::CR_OBJECT_DAMAGE, WorldEntity::classID()); 66 67 67 68 this->range = 1000.0f; -
branches/new_class_id/src/world_entities/weapons/aiming_system.h
r9235 r9709 21 21 class AimingSystem : public WorldEntity 22 22 { 23 NewObjectListDeclaration(AimingSystem); 23 24 24 25 public: -
branches/new_class_id/src/world_entities/weapons/aiming_turret.cc
r9656 r9709 27 27 #include "util/loading/factory.h" 28 28 29 CREATE_FACTORY(AimingTurret, CL_AIMING_TURRET); 30 29 #include "class_id.h" 30 NewObjectListDefinitionID(AimingTurret, CL_AIMING_TURRET); 31 CREATE_FACTORY(AimingTurret); 31 32 32 33 … … 64 65 void AimingTurret::init() 65 66 { 66 this-> setClassID(CL_AIMING_TURRET, "AimingTurret");67 this->registerObject(this, AimingTurret::_objectList); 67 68 68 69 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 86 87 87 88 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET); 88 this->setProjectileType (CL_GUIDED_MISSILE);89 this->setProjectileTypeC("GuidedMissile"); 89 90 90 91 -
branches/new_class_id/src/world_entities/weapons/aiming_turret.h
r9656 r9709 13 13 class AimingTurret : public Weapon 14 14 { 15 NewObjectListDeclaration(AimingTurret); 16 15 17 public: 16 18 AimingTurret (); -
branches/new_class_id/src/world_entities/weapons/boomerang_gun.cc
r9235 r9709 27 27 #include "util/loading/factory.h" 28 28 29 CREATE_FACTORY(BoomerangGun, CL_BOOMERANG_GUN); 29 #include "class_id.h" 30 NewObjectListDefinitionID(BoomerangGun, CL_BOOMERANG_GUN); 31 CREATE_FACTORY(BoomerangGun); 30 32 31 33 … … 61 63 void BoomerangGun::init() 62 64 { 63 this-> setClassID(CL_BOOMERANG_GUN, "BoomerangGun");65 this->registerObject(this, BoomerangGun::_objectList); 64 66 65 67 … … 85 87 86 88 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET); 87 this->setProjectileType (CL_BOOMERANG_PROJECTILE);89 this->setProjectileTypeC("BoomerangProjectile"); 88 90 89 91 this->loadModel("models/guns/turret1.obj", 5.0); -
branches/new_class_id/src/world_entities/weapons/boomerang_gun.h
r9235 r9709 11 11 class BoomerangGun : public Weapon 12 12 { 13 NewObjectListDeclaration(BoomerangGun); 13 14 public: 14 15 BoomerangGun (); -
branches/new_class_id/src/world_entities/weapons/cannon.cc
r9406 r9709 32 32 #include "animation3d.h" 33 33 34 #include "fast_factory.h" 35 36 37 38 39 CREATE_FACTORY(Cannon, CL_CANNON); 34 #include "loading/fast_factory.h" 35 36 37 38 #include "class_id.h" 39 NewObjectListDefinitionID(Cannon, CL_CANNON); 40 CREATE_FACTORY(Cannon); 40 41 41 42 /** … … 69 70 void Cannon::init() 70 71 { 71 this-> setClassID(CL_CANNON, "Cannon");72 this->registerObject(this, Cannon::_objectList); 72 73 73 74 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); … … 88 89 89 90 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY); 90 this->setProjectileType (CL_BOMB);91 this->setProjectileTypeC("Bomb"); 91 92 this->prepareProjectiles(5); 92 93 -
branches/new_class_id/src/world_entities/weapons/cannon.h
r8777 r9709 12 12 class Cannon : public Weapon 13 13 { 14 NewObjectListDeclaration(Cannon); 14 15 public: 15 16 Cannon (); -
branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.cc
r9406 r9709 29 29 30 30 31 #include " fast_factory.h"31 #include "loading/fast_factory.h" 32 32 33 33 #include "fps_sniper_rifle.h" … … 39 39 40 40 41 CREATE_FACTORY(FPSSniperRifle, CL_FPS_SNIPER_RIFLE); 41 #include "class_id.h" 42 NewObjectListDefinitionID(FPSSniperRifle, CL_FPS_SNIPER_RIFLE); 43 CREATE_FACTORY(FPSSniperRifle); 42 44 43 45 /** … … 76 78 void FPSSniperRifle::init() 77 79 { 78 this-> setClassID(CL_FPS_SNIPER_RIFLE, "FPSSniperRifle");80 this->registerObject(this, FPSSniperRifle::_objectList); 79 81 80 82 this->loadModel("models/guns/fps_sniper_rifle.obj", 0.2); … … 98 100 99 101 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 100 this->setProjectileType (CL_LASER);102 this->setProjectileTypeC("Laser"); 101 103 this->prepareProjectiles(20); 102 104 -
branches/new_class_id/src/world_entities/weapons/fps_sniper_rifle.h
r9003 r9709 39 39 class FPSSniperRifle : public Weapon 40 40 { 41 NewObjectListDeclaration(FPSSniperRifle); 42 41 43 public: 42 44 FPSSniperRifle (int leftRight); -
branches/new_class_id/src/world_entities/weapons/hyperblaster.cc
r9406 r9709 31 31 #include "animation3d.h" 32 32 33 #include " fast_factory.h"33 #include "loading/fast_factory.h" 34 34 35 35 36 36 37 38 CREATE_FACTORY(Hyperblaster, CL_HYPERBLASTER); 37 #include "class_id.h" 38 NewObjectListDefinitionID(Hyperblaster, CL_HYPERBLASTER); 39 CREATE_FACTORY(Hyperblaster); 39 40 40 41 Hyperblaster::Hyperblaster(const TiXmlElement* root) … … 56 57 void Hyperblaster::init() 57 58 { 58 this-> setClassID(CL_HYPERBLASTER, "Hyperblaster");59 this->registerObject(this, Hyperblaster::_objectList); 59 60 60 61 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); … … 76 77 77 78 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_HEAVY); 78 this->setProjectileType (CL_HYPERBLAST);79 this->setProjectileTypeC("Hyperblast"); 79 80 this->prepareProjectiles(2); 80 81 -
branches/new_class_id/src/world_entities/weapons/hyperblaster.h
r8777 r9709 12 12 class Hyperblaster : public Weapon 13 13 { 14 public: 14 NewObjectListDeclaration(Hyperblaster); 15 public: 15 16 Hyperblaster (const TiXmlElement* root = NULL); 16 17 virtual ~Hyperblaster (); -
branches/new_class_id/src/world_entities/weapons/laser_cannon.cc
r9656 r9709 29 29 #include "animation3d.h" 30 30 31 #include " fast_factory.h"31 #include "loading/fast_factory.h" 32 32 33 CREATE_FACTORY(LaserCannon, CL_LASER_CANNON); 34 33 #include "class_id.h" 34 NewObjectListDefinitionID(LaserCannon, CL_LASER_CANNON); 35 CREATE_FACTORY(LaserCannon); 35 36 36 37 LaserCannon::LaserCannon(const TiXmlElement* root) … … 52 53 void LaserCannon::init() 53 54 { 54 this-> setClassID(CL_LASER_CANNON, "LaserCannon");55 this->registerObject(this, LaserCannon::_objectList); 55 56 56 57 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/laser_cannon.obj", OBJ, RP_CAMPAIGN); … … 72 73 73 74 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 74 this->setProjectileType (CL_RAIL_PROJECTILE);75 this->setProjectileTypeC("RailProjectile"); 75 76 this->prepareProjectiles(100); 76 77 this->setEmissionPoint(Vector(2.8,0,0) * 5.0); -
branches/new_class_id/src/world_entities/weapons/laser_cannon.h
r9235 r9709 29 29 class LaserCannon : public Weapon 30 30 { 31 public: 31 NewObjectListDeclaration(LaserCannon); 32 public: 32 33 LaserCannon (const TiXmlElement* root = NULL); 33 34 virtual ~LaserCannon (); -
branches/new_class_id/src/world_entities/weapons/targeting_turret.cc
r9656 r9709 26 26 #include "util/loading/factory.h" 27 27 28 CREATE_FACTORY(TargetingTurret, CL_TARGETING_TURRET); 28 #include "class_id.h" 29 NewObjectListDefinitionID(TargetingTurret, CL_TARGETING_TURRET); 30 CREATE_FACTORY(TargetingTurret); 29 31 30 32 … … 48 50 void TargetingTurret::init() 49 51 { 50 this-> setClassID(CL_TARGETING_TURRET, "TargetingTurret");52 this->registerObject(this, TargetingTurret::_objectList); 51 53 52 54 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 70 72 71 73 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET); 72 this->setProjectileType (CL_GUIDED_MISSILE);74 this->setProjectileTypeC("GuidedMissile"); 73 75 74 76 -
branches/new_class_id/src/world_entities/weapons/targeting_turret.h
r9656 r9709 12 12 class TargetingTurret : public Weapon 13 13 { 14 NewObjectListDeclaration(TargetingTurret); 14 15 public: 15 16 TargetingTurret(const TiXmlElement* root = NULL); -
branches/new_class_id/src/world_entities/weapons/test_gun.cc
r9656 r9709 31 31 #include "animation3d.h" 32 32 33 #include "fast_factory.h" 34 35 CREATE_FACTORY(TestGun, CL_TEST_GUN); 36 33 #include "loading/fast_factory.h" 34 35 #include "class_id.h" 36 NewObjectListDefinitionID(TestGun, CL_TEST_GUN); 37 CREATE_FACTORY(TestGun); 37 38 /** 38 39 * standard constructor … … 109 110 void TestGun::init() 110 111 { 111 this->setClassID(CL_TEST_GUN, "TestGun"); 112 112 this->registerObject(this, TestGun::_objectList); 113 113 // this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN); 114 114 … … 129 129 130 130 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 131 this->setProjectileType (CL_LASER);131 this->setProjectileTypeC("Laser"); 132 132 this->prepareProjectiles(100); 133 133 -
branches/new_class_id/src/world_entities/weapons/test_gun.h
r8777 r9709 37 37 class TestGun : public Weapon 38 38 { 39 NewObjectListDeclaration(TestGun); 39 40 public: 40 41 TestGun (int leftRight); -
branches/new_class_id/src/world_entities/weapons/turret.cc
r9406 r9709 27 27 #include "util/loading/factory.h" 28 28 29 CREATE_FACTORY(Turret, CL_TURRET); 30 31 29 #include "class_id.h" 30 NewObjectListDefinitionID(Turret, CL_TURRET); 31 CREATE_FACTORY(Turret); 32 32 33 33 /** … … 62 62 void Turret::init() 63 63 { 64 this-> setClassID(CL_TURRET, "Turret");64 this->registerObject(this, Turret::_objectList); 65 65 66 66 … … 86 86 87 87 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET); 88 this->setProjectileType (CL_ROCKET);88 this->setProjectileTypeC("Rocket"); 89 89 90 90 this->loadModel("models/guns/turret1.obj"); -
branches/new_class_id/src/world_entities/weapons/turret.h
r8777 r9709 11 11 class Turret : public Weapon 12 12 { 13 NewObjectListDeclaration(Turret); 13 14 public: 14 15 Turret (); -
branches/new_class_id/src/world_entities/weapons/weapon.cc
r9705 r9709 21 21 #include "weapon.h" 22 22 23 #include " fast_factory.h"23 #include "loading/fast_factory.h" 24 24 #include "world_entities/projectiles/projectile.h" 25 25
Note: See TracChangeset
for help on using the changeset viewer.