Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10349 in orxonox.OLD for branches/ai/src/ai/swarm_module.cc


Ignore:
Timestamp:
Jan 24, 2007, 6:55:21 PM (17 years ago)
Author:
tfahrni
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ai/src/ai/swarm_module.cc

    r10249 r10349  
    2424
    2525
    26 void SwarmModule::addAI(WorldEntity* npc)
     26void SwarmModule::addAI(WorldEntity* npc, float maxSpeed, float attackDistance)
    2727{
    2828        std::pair< std::map<WorldEntity*,AIModule*>::iterator , bool > p;
    2929        AIModule* newAIModule=new MovementModule(npc);
     30        newAIModule->setAttackDistance(attackDistance);
     31        newAIModule->setMaxSpeed(maxSpeed);
     32        this->attackDistance=attackDistance;
     33        this->maxSpeed=maxSpeed;
    3034        p=members.insert(std::make_pair(npc,newAIModule));
    3135        if(!p.second)delete newAIModule;
    32        
     36
    3337        this->initialize();
    3438}
     
    4044        delete it->second;                                      //delete AIModule
    4145        members.erase(it);                                      //remove AIModule from members
    42        
     46
    4347        this->initialize();
    4448}
     
    7781        this->enemys=other->getEnemyList();
    7882        this->position=other->getPosition();
    79        
     83        this->maxSpeed=other->getMaxSpeed();
     84        this->attackDistance=other->getAttackDistance();
     85
    8086        this->initialize();
    8187}
Note: See TracChangeset for help on using the changeset viewer.