Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 20, 2006, 7:47:45 PM (17 years ago)
Author:
tfahrni
Message:
 
File:
1 edited

Legend:

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

    r10112 r10135  
    1919
    2020#include "npc_test.h"
    21 
     21#include <stdio.h>
    2222
    2323#include "state.h"
     
    3434#include "movement_module.h"
    3535#include "ai_module.h"
    36 
     36#include "ai_team.h"
     37#include "ai_swarm.h"
     38#include "ai_engine.h"
    3739
    3840ObjectListDefinitionID(NPC2, CL_NPC_TEST2);
     
    4345{
    4446        this->registerObject(this, NPC2::_objectList);
    45         if (root != NULL)this->loadParams(root);
    46        
    47         this->aiModule=new MovementModule(this);
     47
     48        if (root != NULL)
     49                this->loadParams(root);
     50
     51        std::cout << "Team Number: " << teamNumber << "\n";
     52        std::cout << "Swarm Number:" << swarmNumber << "\n";
     53
     54        AITeam* myTeam=AIEngine::getInstance()->getCreateTeam(teamNumber);
     55        //std::cout << "Testpoint 4: " << myTeam << "\n";
     56        AISwarm* mySwarm=myTeam->getCreateSwarm(swarmNumber);
     57        //std::cout << "Testpoint 5: " << mySwarm << "\n";
     58        mySwarm->addToSwarm(new MovementModule(this));
     59
    4860}
    4961
    50 
    51 NPC2::~NPC2 ()
    52 {}
    5362
    5463
     
    5665{
    5766  NPC::loadParams(root);
     67
     68  LoadParam(root, "team", this, NPC2, setTeamNumber)
     69                .describe("this sets the team number")
     70                .defaultValues(0);
     71
     72  LoadParam(root, "swarm", this, NPC2, setSwarmNumber)
     73                .describe("this sets the swarm number")
     74                .defaultValues(0);
    5875}
    5976
     
    6582        if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(MD2Model::staticClassID()))
    6683                ((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);
    7184}
    7285
Note: See TracChangeset for help on using the changeset viewer.