Changeset 1232 for code/branches/network3/src/network/Synchronisable.h
- Timestamp:
- May 5, 2008, 1:19:22 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/Synchronisable.h
r1180 r1232 62 62 typedef struct synchronisableVariable{ 63 63 int size; 64 int mode; // this determines in which direction the variable gets synchronised 64 65 void *var; 65 66 variableType type; … … 69 70 /** 70 71 * This class is the base class of all the Objects in the universe that need to be synchronised over the network 71 * Every class, that inherits from this class has to link the DATA THAT NEEDS TO BE SYNCHRONISED into the linked list. Additionally it also has to provide a Constructor, that takes exactly the variables in this linked list. 72 * Every class, t 73 int mode;hat inherits from this class has to link the DATA THAT NEEDS TO BE SYNCHRONISED into the linked list. Additionally it also has to provide a Constructor, that takes exactly the variables in this linked list. 72 74 * @author Oliver Scheuss 73 75 */ … … 79 81 int classID; 80 82 81 void registerVar(void *var, int size, variableType t );83 void registerVar(void *var, int size, variableType t, int mode=1); 82 84 // syncData getData(); 83 85 syncData getData(unsigned char *mem); 84 86 int getSize(); 85 87 bool updateData(syncData vars); 88 void setBacksync(bool sync); 89 bool getBacksync(); 86 90 virtual void registerAllVariables()=0; 87 91 virtual bool create()=0; 92 static void setClient(bool b); 88 93 protected: 89 94 Synchronisable(); … … 93 98 std::list<synchronisableVariable *> *syncList; 94 99 int datasize; 100 static int state_; // detemines wheter we are server (default) or client 101 bool backsync_; // if true the variables with mode > 1 will be synchronised to server (client -> server) 95 102 }; 96 103 }
Note: See TracChangeset
for help on using the changeset viewer.