Changeset 5992 in orxonox.OLD for branches/network/src/lib/network/synchronizeable.cc
- Timestamp:
- Dec 8, 2005, 5:13:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.cc
r5829 r5992 12 12 ### File Specific: 13 13 main-programmer: Silvan Nellen 14 co-programmer: ...14 co-programmer: Benjamin Wuest 15 15 */ 16 16 … … 23 23 */ 24 24 Synchronizeable::Synchronizeable() 25 {} 25 { 26 27 //owner = ?; 28 //hostID = ?; 29 //state = ?; 30 31 } 26 32 27 33 /** … … 59 65 void Synchronizeable::readDebug() const 60 66 {} 67 68 69 70 71 72 /** 73 * Sets the server flag to a given value 74 * @param isServer: the boolean value which the server flag is to set to 75 */ 76 void Synchronizeable::setIsServer(bool isServer) 77 { 78 if( isServer ) 79 this->state = this->state | STATE_SERVER; 80 else 81 this->state = this->state & (~STATE_SERVER); 82 } 83 84 /** 85 * Sets the outofsync flag to a given value 86 * @param outOfSync: the boolean value which the outofsync flag is to set to 87 */ 88 void Synchronizeable::setIsOutOfSync(bool outOfSync) 89 { 90 if( outOfSync ) 91 this->state = this->state | STATE_OUTOFSYNC; 92 else 93 this->state = this->state & (~STATE_OUTOFSYNC); 94 } 95 96 /** 97 * Determines if the server flag is set 98 * @return true, if the server flag is true, false else 99 */ 100 bool Synchronizeable::isServer() 101 { 102 return this->state & STATE_SERVER == STATE_SERVER; 103 } 104 105 /** 106 * Determines if the outofsync flag is set 107 * @return true, if the outofsync flag is true, false else 108 */ 109 bool Synchronizeable::isOutOfSync() 110 { 111 return this->state & STATE_OUTOFSYNC == STATE_OUTOFSYNC; 112 }
Note: See TracChangeset
for help on using the changeset viewer.