Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2007, 4:27:43 PM (17 years ago)
Author:
patrick
Message:

ai is now handeled in npc, weapon manager added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ai/src/world_entities/npcs/npc_test.cc

    r10226 r10263  
    3232
    3333#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
    3935
    4036ObjectListDefinitionID(NPC2, CL_NPC_TEST2);
     
    4238
    4339
    44 NPC2::NPC2(const TiXmlElement* root) : NPC(NULL)
     40NPC2::NPC2(const TiXmlElement* root)
    4541{
    46         this->registerObject(this, NPC2::_objectList);
     42  this->registerObject(this, NPC2::_objectList);
    4743
    48         if (root != NULL)
    49                 this->loadParams(root);
     44  if (root != NULL)
     45    this->loadParams(root);
    5046
    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
    5650}
    5751
    5852NPC2::~NPC2()
    5953{
    60         AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this);
    6154}
    6255
     
    6558  NPC::loadParams(root);
    6659
    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);
    7460}
    7561
     
    7864void NPC2::tick(float dt)
    7965{
    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);
    8373}
    8474
Note: See TracChangeset for help on using the changeset viewer.