Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2007, 10:39:12 AM (16 years ago)
Author:
scheusso
Message:

added class BaseEntity:

  • !!! please inherit from this class in future (instead of Entity/WorldEntity/BaseObject):
  • this class is able to be synchronised over the network (or at least created so far)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/Synchronisable.h

    r496 r565  
    1515#include <list>
    1616#include <iostream>
     17#include <string>
    1718
    1819#include "orxonox/core/CoreIncludes.h"
     
    2122namespace network {
    2223
     24enum variableType{
     25  DATA,
     26  STRING,
     27};
    2328 
    2429struct syncData{
     
    3237  int size;
    3338  const void *var;
     39  variableType type;
    3440}SYNCVAR;
    3541
     
    4046 * @author Oliver Scheuss
    4147*/
    42 class Synchronisable : public orxonox::OrxonoxClass{
     48class Synchronisable : virtual public orxonox::OrxonoxClass{
    4349public:
    44   Synchronisable();
    4550
    4651  virtual ~Synchronisable();
     
    4853  int classID;
    4954   
    50   void registerVar(const void *var, int size);
     55  void registerVar(const void *var, int size, variableType t);
    5156  syncData getData();
    5257  syncData getData(unsigned char *mem);
    5358  int getSize();
    5459  bool updateData(syncData vars);
    55   virtual void registerAllVariables() = 0;
    56 
     60  virtual void registerAllVariables()=0;
     61  virtual bool create(){return true;}
     62protected:
     63  Synchronisable();
    5764private:
    5865/*  bool removeObject(Iterator<Synchronisable> it);*/
Note: See TracChangeset for help on using the changeset viewer.