Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9051 in orxonox.OLD


Ignore:
Timestamp:
Jul 3, 2006, 5:15:21 PM (18 years ago)
Author:
patrick
Message:

stop/resume functions

Location:
branches/single_player_map/src/world_entities/npcs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/npcs/generic_npc.cc

    r9043 r9051  
    181181void GenericNPC::stop()
    182182{
    183 
    184 }
    185 
    186 
    187 
     183  this->animationStack.push(this->behaviourList);
     184  this->behaviourList = new std::list<GenericNPC::Anim>;
     185}
     186
     187
     188/**
     189 * continue the generic animation
     190 */
     191void GenericNPC::resume()
     192{
     193  delete this->behaviourList;
     194  this->behaviourList = this->animationStack.top();
     195  this->animationStack.pop();
     196}
     197
     198
     199/**
     200 * each animation has to be initialized here
     201 */
    188202void GenericNPC::initNPC()
    189203{
  • branches/single_player_map/src/world_entities/npcs/generic_npc.h

    r9042 r9051  
    5555  /* stopping the movement */
    5656  void stop();
     57  void resume();
    5758  void nextStep();
    5859
     
    126127
    127128   std::list<GenericNPC::Anim>*            behaviourList;
    128    std::stack<std::list<GenericNPC::Anim>* > animationStack;
     129   std::stack<std::list<GenericNPC::Anim>*> animationStack;
    129130   Vector                                  destCoor;
    130131   Quaternion                              destDir;
Note: See TracChangeset for help on using the changeset viewer.