- Timestamp:
- Oct 14, 2008, 12:20:14 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/network/Synchronisable.h
r1910 r1916 46 46 #define REGISTERSTRING_WITHDIR(stringname, mode) registerVar(&stringname, stringname.length()+1, network::STRING, mode) 47 47 48 //TODO: this is only a very ugly hack ...49 namespace orxonox{50 class SpaceShip;51 }52 53 48 namespace network 54 49 { … … 60 55 }; 61 56 } 62 57 63 58 namespace syncmode{ 64 59 enum mode{ … … 67 62 }; 68 63 } 69 64 70 65 enum variableType{ 71 66 DATA, … … 73 68 }; 74 69 75 struct synchronisableHeader{70 struct _NetworkExport synchronisableHeader{ 76 71 uint32_t size:31; 77 72 bool dataAvailable:1; … … 80 75 }; 81 76 82 typedef struct synchronisableVariable{77 typedef struct _NetworkExport synchronisableVariable{ 83 78 unsigned int size; 84 79 int mode; // this determines in which direction the variable gets synchronised … … 98 93 friend class GamestateClient; 99 94 friend class Server; 100 friend class orxonox::SpaceShip;101 95 virtual ~Synchronisable(); 102 96 103 97 104 98 virtual bool create(); 105 99 static void setClient(bool b); 106 100 107 101 static Synchronisable *fabricate(uint8_t*& mem, int mode=0x0); 108 102 static bool deleteObject(unsigned int objectID); … … 110 104 static unsigned int getNumberOfDeletedObject(){ return deletedObjects_.size(); } 111 105 static unsigned int popDeletedObject(){ unsigned int i = deletedObjects_.front(); deletedObjects_.pop(); return i; } 112 106 113 107 inline unsigned int getObjectID(){return objectID;} 114 108 inline unsigned int getClassID(){return classID;} … … 119 113 void setObjectFrequency(unsigned int freq){ objectFrequency_ = freq; } 120 114 virtual void registerAllVariables()=0; 121 122 115 116 123 117 private: 124 118 bool getData(uint8_t*& men, unsigned int id, int mode=0x0); … … 128 122 bool doSelection(unsigned int id); 129 123 bool isMyTick(unsigned int id); 130 124 131 125 unsigned int objectID; 132 126 unsigned int classID; 133 127 134 128 std::list<synchronisableVariable *> *syncList; 135 129 static int state_; // detemines wheter we are server (default) or client
Note: See TracChangeset
for help on using the changeset viewer.