Changeset 10263 in orxonox.OLD for branches/ai/src/world_entities/npcs/npc_test.cc
- Timestamp:
- Jan 17, 2007, 4:27:43 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ai/src/world_entities/npcs/npc_test.cc
r10226 r10263 32 32 33 33 #include "class_id_DEPRECATED.h" 34 #include "movement_module.h" 35 #include "ai_module.h" 36 #include "ai_team.h" 37 #include "ai_swarm.h" 38 #include "ai_engine.h" 34 39 35 40 36 ObjectListDefinitionID(NPC2, CL_NPC_TEST2); … … 42 38 43 39 44 NPC2::NPC2(const TiXmlElement* root) : NPC(NULL)40 NPC2::NPC2(const TiXmlElement* root) 45 41 { 46 42 this->registerObject(this, NPC2::_objectList); 47 43 48 49 44 if (root != NULL) 45 this->loadParams(root); 50 46 51 std::cout << "Team Number: " << teamNumber << "\n"; 52 std::cout << "Swarm Number:" << swarmNumber << "\n"; 53 //aiModule=new MovementModule(this); 54 //AIEngine::getInstance()->addAI(teamNumber,swarmNumber,aiModule); 55 AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this); 47 48 // create the weapons and their manager 49 56 50 } 57 51 58 52 NPC2::~NPC2() 59 53 { 60 AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this);61 54 } 62 55 … … 65 58 NPC::loadParams(root); 66 59 67 LoadParam(root, "team", this, NPC2, setTeamNumber)68 .describe("this sets the team number")69 .defaultValues(0);70 71 LoadParam(root, "swarm", this, NPC2, setSwarmNumber)72 .describe("this sets the swarm number")73 .defaultValues(0);74 60 } 75 61 … … 78 64 void NPC2::tick(float dt) 79 65 { 80 // animating the md2 model 81 if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(MD2Model::staticClassID())) 82 ((MD2Model*)this->getModel(0))->tick(dt); 66 67 68 69 70 // animating the md2 model 71 if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(MD2Model::staticClassID())) 72 ((MD2Model*)this->getModel(0))->tick(dt); 83 73 } 84 74
Note: See TracChangeset
for help on using the changeset viewer.