Changeset 6273 in orxonox.OLD for branches/network/src/lib/network/synchronizeable.cc
- Timestamp:
- Dec 23, 2005, 5:30:22 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/synchronizeable.cc
r6252 r6273 30 30 this->setClassID(CL_SYNCHRONIZEABLE, "Synchronizeable"); 31 31 owner = 0; 32 state = 0; 32 33 hostID = NetworkManager::getInstance()->getHostID(); 33 34 this->setIsServer(this->hostID == 0); 34 35 uniqueID = -1; 35 36 this->networkStream = NULL; 37 this->setRequestedSync( false ); 36 38 } 37 39 … … 94 96 else 95 97 this->state = this->state & (~STATE_OUTOFSYNC); 98 //PRINTF(0)("isoutofsync %s %d\n", this->getClassName(), state); 96 99 } 97 100 … … 102 105 bool Synchronizeable::isServer() 103 106 { 104 return this->state & STATE_SERVER == STATE_SERVER;107 return (this->state & STATE_SERVER) >0; 105 108 } 106 109 … … 111 114 bool Synchronizeable::isOutOfSync() 112 115 { 113 return this->state & STATE_OUTOFSYNC == STATE_OUTOFSYNC; 116 return (this->state & STATE_OUTOFSYNC) >0; 117 } 118 119 /** 120 * Determines if the requestedSync flag is set 121 * @return true, if the requestedSync flag is true, false else 122 */ 123 bool Synchronizeable::requestedSync() 124 { 125 return (this->state & STATE_REQUESTEDSYNC) >0; 126 } 127 128 /** 129 * Sets the requestedsync flag to a given value 130 * @param requestedSync: the boolean value which the requestedsync flag is to set to 131 */ 132 void Synchronizeable::setRequestedSync( bool requestedSync ) 133 { 134 if( requestedSync ) 135 this->state = this->state | STATE_REQUESTEDSYNC; 136 else 137 this->state = this->state & (~STATE_REQUESTEDSYNC); 114 138 } 115 139
Note: See TracChangeset
for help on using the changeset viewer.