Changeset 10263 in orxonox.OLD for branches/ai/src/world_entities/npcs/npc.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.cc
r9869 r10263 18 18 19 19 20 #include "movement_module.h" 21 #include "ai_module.h" 22 #include "ai_team.h" 23 #include "ai_swarm.h" 24 #include "ai_engine.h" 25 26 #include "loading/load_param.h" 27 28 20 29 #include "npc.h" 21 30 … … 23 32 24 33 NPC::NPC(const TiXmlElement* root) 34 : weaponMan(this) 25 35 { 26 36 this->registerObject(this, NPC::_objectList); … … 28 38 this->toList(OM_GROUP_00); 29 39 40 std::cout << "Team Number: " << teamNumber << "\n"; 41 std::cout << "Swarm Number:" << swarmNumber << "\n"; 42 //aiModule=new MovementModule(this); 43 //AIEngine::getInstance()->addAI(teamNumber,swarmNumber,aiModule); 44 AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this); 45 46 this->bFire = false; 47 30 48 } 31 49 32 50 33 NPC::~NPC () {} 34 35 36 37 /** 38 * adds an AI to this NPC 39 */ 40 void NPC::addAI(AI* ai) 41 {} 51 NPC::~NPC () 52 { 53 AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this); 54 } 42 55 43 56 … … 50 63 { 51 64 WorldEntity::loadParams(root); 65 66 LoadParam(root, "team", this, NPC, setTeamNumber) 67 .describe("this sets the team number") 68 .defaultValues(0); 69 70 LoadParam(root, "swarm", this, NPC, setSwarmNumber) 71 .describe("this sets the swarm number") 72 .defaultValues(0); 52 73 } 53 74 75 76 void NPC::tick(float dt) 77 { 78 this->weaponMan.tick(dt); 79 if (this->bFire) 80 weaponMan.fire(); 81 }
Note: See TracChangeset
for help on using the changeset viewer.