Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 10, 2008, 5:03:34 PM (17 years ago)
Author:
bknecht
Message:

merged back that script-branch

Location:
code/trunk/src/orxonox/objects/weapon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.cc

    r871 r1021  
    4545  {
    4646    RegisterObject(AmmunitionDump);
     47    registerAllVariables();
    4748
    4849    for (int i = 0; i < numberOfAmmos_; i++)
     
    114115    return stock_[id];
    115116  }
     117 
     118  void AmmunitionDump::registerAllVariables(){
     119    registerVar( &numberOfAmmos_, sizeof(int), network::DATA);
     120   
     121    for (int i = 0; i < numberOfAmmos_; i++)
     122    {
     123      registerVar(&stock_[i], sizeof(int), network::DATA);
     124      registerVar(&capacity_[i], sizeof(int), network::DATA);
     125    }
     126  }
    116127}
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.h

    r871 r1021  
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    int numberOfAmmos_;
  • code/trunk/src/orxonox/objects/weapon/BulletManager.cc

    r871 r1021  
    3939  {
    4040    RegisterObject(BulletManager);
     41    registerAllVariables();
    4142    bullets_ = new Bullet*[bulletsSize_];
    4243  }
     
    103104  }
    104105
     106  void BulletManager::registerAllVariables(){
     107    registerVar(&bulletsSize_, sizeof(int), network::DATA);
     108    registerVar(&bulletsIndex_, sizeof(int), network::DATA);
     109    // TODO we got a problem here:
     110    // there is no possibility (so far) to synchronise pointers to objects
     111  }
     112 
    105113}
  • code/trunk/src/orxonox/objects/weapon/BulletManager.h

    r871 r1021  
    3939#include "util/tinyxml/tinyxml.h"
    4040#include "core/BaseObject.h"
    41 #include "../Tickable.h"
     41#include "core/Tickable.h"
    4242
    4343namespace orxonox {
     
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    // Bullet array
Note: See TracChangeset for help on using the changeset viewer.