Changeset 10112 in orxonox.OLD for branches/ai/src/world_entities
- Timestamp:
- Dec 19, 2006, 11:38:01 PM (18 years ago)
- Location:
- branches/ai/src/world_entities/npcs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ai/src/world_entities/npcs/npc_test.cc
r10071 r10112 32 32 33 33 #include "class_id_DEPRECATED.h" 34 #include "movement_module.h" 35 #include "ai_module.h" 36 34 37 35 38 ObjectListDefinitionID(NPC2, CL_NPC_TEST2); … … 39 42 NPC2::NPC2(const TiXmlElement* root) : NPC(NULL) 40 43 { 41 this->registerObject(this, NPC2::_objectList); 42 43 if (root != NULL)this->loadParams(root); 44 45 addToTeam(0); 44 this->registerObject(this, NPC2::_objectList); 45 if (root != NULL)this->loadParams(root); 46 47 this->aiModule=new MovementModule(this); 46 48 } 47 49 … … 60 62 void NPC2::tick(float dt) 61 63 { 62 64 // animating the md2 model 63 65 if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(MD2Model::staticClassID())) 64 ((MD2Model*)this->getModel(0))->tick(dt); 66 ((MD2Model*)this->getModel(0))->tick(dt); 67 68 // processing AI 69 //PRINTF(0)("Processing NPC\n"); 70 if(this->aiModule!=NULL)this->aiModule->process(dt); 65 71 } 66 72 -
branches/ai/src/world_entities/npcs/npc_test.h
r10045 r10112 4 4 5 5 #include "npc.h" 6 #include "ai_module.h" 6 7 7 8 class AI; 8 9 class Shader; 10 class AIModule; 9 11 10 12 class NPC2 : public NPC { … … 17 19 virtual void tick(float dt); 18 20 19 private: 20 21 int team; 22 int swarm; 23 int difficulty; 24 AIModule* aiModule; 21 25 }; 22 26
Note: See TracChangeset
for help on using the changeset viewer.