Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2860 in orxonox.OLD for orxonox/branches/dave/src/command_node.cc


Ignore:
Timestamp:
Nov 15, 2004, 11:13:21 PM (21 years ago)
Author:
dave
Message:

orxonox/branches/dave: das level hat jetzt form angenommen, stand:nach der Convention vom Samstag….

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/dave/src/command_node.cc

    r2636 r2860  
    1111   ### File Specific:
    1212   main-programmer: Christian Meyer
    13    co-programmer: ...
     13   co-programmer: Patrick Boenzli
    1414*/
    1515
     
    3333CommandNode::CommandNode (int ID)
    3434{
    35   bound = new List<WorldEntity>();
     35  bound = new List();
    3636  aliases = NULL;
    3737  netID = ID;
     
    4848  bLocalInput = true;
    4949  netID = 0;
    50   bound = new List<WorldEntity>();
     50  bound = new List();
    5151  load_bindings (filename);
    5252}
     
    5959  if( aliases != NULL) free (aliases);
    6060  if( bound != NULL) delete bound;
     61}
     62
     63
     64void CommandNode::reset()
     65{
     66  this->bound->clear();
    6167}
    6268
     
    123129void CommandNode::bind (WorldEntity* entity)
    124130{
    125   bound->add (entity, LIST_ADD_NEXT, true);
     131  bound->add (entity);
    126132}
    127133
     
    132138void CommandNode::unbind (WorldEntity* entity)
    133139{
    134   bound->remove (entity, LIST_FIND_FW);
     140  bound->remove (entity);
    135141}
    136142
     
    214220}
    215221
     222
    216223void CommandNode::process_network ()
    217224{
     
    219226}
    220227
     228
    221229void CommandNode::relay (Command* cmd)
    222230{
    223   //printf("CommandNode|relay()\n");
    224   List<WorldEntity>* plist = bound;
    225231 
    226232  Orxonox *orx = Orxonox::getInstance();
     
    231237  if( bLocalInput) send_over_network (cmd);
    232238 
    233   while( (plist = plist->get_next()) != NULL)
    234     {
    235       plist->get_object()->command (cmd);
    236     }
    237 }
     239  WorldEntity* entity = bound->enumerate();
     240  while(  entity != NULL)
     241    {
     242      entity->command (cmd);
     243      entity = bound->nextElement();
     244    }
     245}
     246
    238247
    239248/**
Note: See TracChangeset for help on using the changeset viewer.