Changeset 3257 for code/branches/core4/src/orxonox/objects
- Timestamp:
- Jun 30, 2009, 3:14:45 PM (16 years ago)
- Location:
- code/branches/core4/src/orxonox/objects
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/orxonox/objects/GlobalShader.cc
r3196 r3257 66 66 void GlobalShader::registerVariables() 67 67 { 68 registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility));69 registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), variableDirection::toclient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor));68 registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility)); 69 registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), VariableDirection::ToClient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor)); 70 70 } 71 71 -
code/branches/core4/src/orxonox/objects/Level.cc
r3239 r3257 87 87 void Level::registerVariables() 88 88 { 89 registerVariable(this->xmlfilename_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));90 registerVariable(this->name_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::changedName));91 registerVariable(this->description_, variableDirection::toclient);89 registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile)); 90 registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName)); 91 registerVariable(this->description_, VariableDirection::ToClient); 92 92 } 93 93 -
code/branches/core4/src/orxonox/objects/Scene.cc
r3239 r3257 115 115 void Scene::registerVariables() 116 116 { 117 registerVariable(this->skybox_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));118 registerVariable(this->ambientLight_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));119 registerVariable(this->negativeWorldRange_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_negativeWorldRange));120 registerVariable(this->positiveWorldRange_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_positiveWorldRange));121 registerVariable(this->gravity_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_gravity));122 registerVariable(this->bHasPhysics_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));123 registerVariable(this->bShadows_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));117 registerVariable(this->skybox_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox)); 118 registerVariable(this->ambientLight_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight)); 119 registerVariable(this->negativeWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_negativeWorldRange)); 120 registerVariable(this->positiveWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_positiveWorldRange)); 121 registerVariable(this->gravity_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_gravity)); 122 registerVariable(this->bHasPhysics_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics)); 123 registerVariable(this->bShadows_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows)); 124 124 } 125 125 -
code/branches/core4/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc
r3196 r3257 57 57 void BoxCollisionShape::registerVariables() 58 58 { 59 registerVariable(this->halfExtents_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));59 registerVariable(this->halfExtents_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 60 60 } 61 61 -
code/branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc
r3239 r3257 77 77 void CollisionShape::registerVariables() 78 78 { 79 registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged));79 registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged)); 80 80 } 81 81 -
code/branches/core4/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc
r3196 r3257 57 57 void ConeCollisionShape::registerVariables() 58 58 { 59 registerVariable(this->radius_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));60 registerVariable(this->height_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));59 registerVariable(this->radius_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 60 registerVariable(this->height_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 61 61 } 62 62 -
code/branches/core4/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
r3196 r3257 58 58 void PlaneCollisionShape::registerVariables() 59 59 { 60 registerVariable(this->normal_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));61 registerVariable(this->offset_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));60 registerVariable(this->normal_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 61 registerVariable(this->offset_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 62 62 } 63 63 -
code/branches/core4/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc
r3196 r3257 56 56 void SphereCollisionShape::registerVariables() 57 57 { 58 registerVariable(this->radius_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));58 registerVariable(this->radius_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); 59 59 } 60 60 -
code/branches/core4/src/orxonox/objects/controllers/ArtificialController.cc
r3239 r3257 208 208 switch (base->getState()) 209 209 { 210 case BaseState:: controlTeam1:210 case BaseState::ControlTeam1: 211 211 team1 = 0; 212 212 break; 213 case BaseState:: controlTeam2:213 case BaseState::ControlTeam2: 214 214 team1 = 1; 215 215 break; 216 case BaseState:: uncontrolled:216 case BaseState::Uncontrolled: 217 217 default: 218 218 team1 = -1; … … 224 224 switch (base->getState()) 225 225 { 226 case BaseState:: controlTeam1:226 case BaseState::ControlTeam1: 227 227 team2 = 0; 228 228 break; 229 case BaseState:: controlTeam2:229 case BaseState::ControlTeam2: 230 230 team2 = 1; 231 231 break; 232 case BaseState:: uncontrolled:232 case BaseState::Uncontrolled: 233 233 default: 234 234 team2 = -1; -
code/branches/core4/src/orxonox/objects/gametypes/Gametype.h
r3196 r3257 45 45 namespace PlayerState 46 46 { 47 enum Enum47 enum Value 48 48 { 49 49 Uninitialized, … … 57 57 { 58 58 PlayerInfo* info_; 59 PlayerState:: Enumstate_;59 PlayerState::Value state_; 60 60 int frags_; 61 61 int killed_; -
code/branches/core4/src/orxonox/objects/gametypes/TeamBaseMatch.cc
r3239 r3257 66 66 if (teamnr == 0) 67 67 { 68 base->setState(BaseState:: controlTeam1);68 base->setState(BaseState::ControlTeam1); 69 69 this->gtinfo_.sendAnnounceMessage("The red team captured a base"); 70 70 } 71 71 if (teamnr == 1) 72 72 { 73 base->setState(BaseState:: controlTeam2);73 base->setState(BaseState::ControlTeam2); 74 74 this->gtinfo_.sendAnnounceMessage("The blue team captured a base"); 75 75 } … … 107 107 switch (base->getState()) 108 108 { 109 case BaseState:: controlTeam1:109 case BaseState::ControlTeam1: 110 110 teamnrbase = 0; 111 111 break; 112 case BaseState:: controlTeam2:112 case BaseState::ControlTeam2: 113 113 teamnrbase = 1; 114 114 break; 115 case BaseState:: uncontrolled:115 case BaseState::Uncontrolled: 116 116 default: 117 117 teamnrbase = -1; … … 155 155 for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it) 156 156 { 157 if((*it)->getState() == BaseState:: controlTeam1)157 if((*it)->getState() == BaseState::ControlTeam1) 158 158 { 159 159 amountControlled++; 160 160 } 161 if((*it)->getState() == BaseState:: controlTeam2)161 if((*it)->getState() == BaseState::ControlTeam2) 162 162 { 163 163 amountControlled2++; … … 241 241 for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it) 242 242 { 243 if ((*it)->getState() == BaseState:: controlTeam1 && team == 0)243 if ((*it)->getState() == BaseState::ControlTeam1 && team == 0) 244 244 count++; 245 if ((*it)->getState() == BaseState:: controlTeam2 && team == 1)245 if ((*it)->getState() == BaseState::ControlTeam2 && team == 1) 246 246 count++; 247 247 } … … 253 253 { 254 254 this->bases_.insert(base); 255 base->setState(BaseState:: uncontrolled);255 base->setState(BaseState::Uncontrolled); 256 256 } 257 257 -
code/branches/core4/src/orxonox/objects/infos/GametypeInfo.cc
r3196 r3257 61 61 void GametypeInfo::registerVariables() 62 62 { 63 registerVariable(this->bStarted_, variableDirection::toclient);64 registerVariable(this->bEnded_, variableDirection::toclient);65 registerVariable(this->startCountdown_, variableDirection::toclient);66 registerVariable(this->bStartCountdownRunning_, variableDirection::toclient);67 registerVariable(this->hudtemplate_, variableDirection::toclient);63 registerVariable(this->bStarted_, VariableDirection::ToClient); 64 registerVariable(this->bEnded_, VariableDirection::ToClient); 65 registerVariable(this->startCountdown_, VariableDirection::ToClient); 66 registerVariable(this->bStartCountdownRunning_, VariableDirection::ToClient); 67 registerVariable(this->hudtemplate_, VariableDirection::ToClient); 68 68 } 69 69 -
code/branches/core4/src/orxonox/objects/infos/HumanPlayer.cc
r3196 r3257 79 79 void HumanPlayer::registerVariables() 80 80 { 81 registerVariable(this->synchronize_nick_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));81 registerVariable(this->synchronize_nick_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick)); 82 82 83 registerVariable(this->clientID_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));84 registerVariable(this->server_initialized_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));85 registerVariable(this->client_initialized_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));83 registerVariable(this->clientID_, VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged)); 84 registerVariable(this->server_initialized_, VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized)); 85 registerVariable(this->client_initialized_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized)); 86 86 } 87 87 … … 116 116 117 117 if (!GameMode::isMaster()) 118 this->setObjectMode( objectDirection::bidirectional);118 this->setObjectMode(ObjectDirection::Bidirectional); 119 119 else 120 120 this->setName(this->nick_); -
code/branches/core4/src/orxonox/objects/infos/PlayerInfo.cc
r3239 r3257 77 77 void PlayerInfo::registerVariables() 78 78 { 79 registerVariable(this->name_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));80 registerVariable(this->controllableEntityID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));81 registerVariable(this->bReadyToSpawn_, variableDirection::toserver);82 registerVariable(this->gtinfoID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));79 registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName)); 80 registerVariable(this->controllableEntityID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID)); 81 registerVariable(this->bReadyToSpawn_, VariableDirection::ToServer); 82 registerVariable(this->gtinfoID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID)); 83 83 } 84 84 -
code/branches/core4/src/orxonox/objects/items/Engine.cc
r3239 r3257 113 113 void Engine::registerVariables() 114 114 { 115 registerVariable(this->shipID_, variableDirection::toclient, new NetworkCallback<Engine>(this, &Engine::networkcallback_shipID));116 117 registerVariable(this->speedFactor_, variableDirection::toclient);118 registerVariable(this->boostFactor_, variableDirection::toclient);119 120 registerVariable(this->maxSpeedFront_, variableDirection::toclient);121 registerVariable(this->maxSpeedBack_, variableDirection::toclient);122 registerVariable(this->maxSpeedLeftRight_, variableDirection::toclient);123 registerVariable(this->maxSpeedUpDown_, variableDirection::toclient);124 125 registerVariable(this->accelerationFront_, variableDirection::toclient);126 registerVariable(this->accelerationBrake_, variableDirection::toclient);127 registerVariable(this->accelerationBack_, variableDirection::toclient);128 registerVariable(this->accelerationLeftRight_, variableDirection::toclient);129 registerVariable(this->accelerationUpDown_, variableDirection::toclient);115 registerVariable(this->shipID_, VariableDirection::ToClient, new NetworkCallback<Engine>(this, &Engine::networkcallback_shipID)); 116 117 registerVariable(this->speedFactor_, VariableDirection::ToClient); 118 registerVariable(this->boostFactor_, VariableDirection::ToClient); 119 120 registerVariable(this->maxSpeedFront_, VariableDirection::ToClient); 121 registerVariable(this->maxSpeedBack_, VariableDirection::ToClient); 122 registerVariable(this->maxSpeedLeftRight_, VariableDirection::ToClient); 123 registerVariable(this->maxSpeedUpDown_, VariableDirection::ToClient); 124 125 registerVariable(this->accelerationFront_, VariableDirection::ToClient); 126 registerVariable(this->accelerationBrake_, VariableDirection::ToClient); 127 registerVariable(this->accelerationBack_, VariableDirection::ToClient); 128 registerVariable(this->accelerationLeftRight_, VariableDirection::ToClient); 129 registerVariable(this->accelerationUpDown_, VariableDirection::ToClient); 130 130 } 131 131 -
code/branches/core4/src/orxonox/objects/items/MultiStateEngine.cc
r3196 r3257 82 82 void MultiStateEngine::registerVariables() 83 83 { 84 registerVariable(this->state_, variableDirection::toserver);84 registerVariable(this->state_, VariableDirection::ToServer); 85 85 } 86 86 … … 91 91 if (this->getShip()->hasLocalController()) 92 92 { 93 this->setObjectMode( objectDirection::bidirectional);93 this->setObjectMode(ObjectDirection::Bidirectional); 94 94 95 95 const Vector3& direction = this->getDirection(); -
code/branches/core4/src/orxonox/objects/pickup/ModifierPickup.cc
r3196 r3257 87 87 if (this->addTo(pawn)) 88 88 { 89 std::map<ModifierType:: Enum, float>::iterator it;89 std::map<ModifierType::Value, float>::iterator it; 90 90 91 91 for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++) … … 124 124 if (this->removeFrom(pawn)) 125 125 { 126 std::map<ModifierType:: Enum, float>::iterator it;126 std::map<ModifierType::Value, float>::iterator it; 127 127 128 128 for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++) … … 158 158 @return Returns the additive modifier for type (or 0 if not exists). 159 159 */ 160 float ModifierPickup::getAdditiveModifier(ModifierType:: Enumtype) const161 { 162 std::map<ModifierType:: Enum, float>::const_iterator it = this->additiveModifiers_.find(type);160 float ModifierPickup::getAdditiveModifier(ModifierType::Value type) const 161 { 162 std::map<ModifierType::Value, float>::const_iterator it = this->additiveModifiers_.find(type); 163 163 if (it != this->additiveModifiers_.end()) 164 164 return (*it).second; … … 171 171 @return Returns the multiplicative modifier for type (or 1 if not exists). 172 172 */ 173 float ModifierPickup::getMultiplicativeModifier(ModifierType:: Enumtype) const174 { 175 std::map<ModifierType:: Enum, float>::const_iterator it = this->multiplicativeModifiers_.find(type);173 float ModifierPickup::getMultiplicativeModifier(ModifierType::Value type) const 174 { 175 std::map<ModifierType::Value, float>::const_iterator it = this->multiplicativeModifiers_.find(type); 176 176 if (it != this->multiplicativeModifiers_.end()) 177 177 return (*it).second; … … 184 184 @param value The new additive modifier for type. 185 185 */ 186 void ModifierPickup::setAdditiveModifier(ModifierType:: Enumtype, float value)186 void ModifierPickup::setAdditiveModifier(ModifierType::Value type, float value) 187 187 { 188 188 if (this->additiveModifiers_.find(type) == this->additiveModifiers_.end()) 189 this->additiveModifiers_.insert( std::pair<ModifierType:: Enum, float>(type, value) );189 this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) ); 190 190 else 191 191 this->additiveModifiers_[type] = value; … … 196 196 @param value The new multiplicative modifier for type. 197 197 */ 198 void ModifierPickup::setMultiplicativeModifier(ModifierType:: Enumtype, float value)198 void ModifierPickup::setMultiplicativeModifier(ModifierType::Value type, float value) 199 199 { 200 200 if (this->multiplicativeModifiers_.find(type) == this->multiplicativeModifiers_.end()) 201 this->multiplicativeModifiers_.insert( std::pair<ModifierType:: Enum, float>(type, value) );201 this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) ); 202 202 else 203 203 this->multiplicativeModifiers_[type] = value; -
code/branches/core4/src/orxonox/objects/pickup/ModifierPickup.h
r3196 r3257 130 130 void timerCallback(Pawn* pawn); //!< Method called when the timer runs out. 131 131 private: 132 float getAdditiveModifier(ModifierType:: Enumtype) const; //!< Get the additive modifier for a given ModifierType.133 float getMultiplicativeModifier(ModifierType:: Enumtype) const; //!< Get the multiplicative modifier for a given ModifierType.134 void setAdditiveModifier(ModifierType:: Enumtype, float value); //!< Set the additive modifier for a given ModifierType.135 void setMultiplicativeModifier(ModifierType:: Enumtype, float value); //!< Set the multiplicative modifier for a given ModifierType132 float getAdditiveModifier(ModifierType::Value type) const; //!< Get the additive modifier for a given ModifierType. 133 float getMultiplicativeModifier(ModifierType::Value type) const; //!< Get the multiplicative modifier for a given ModifierType. 134 void setAdditiveModifier(ModifierType::Value type, float value); //!< Set the additive modifier for a given ModifierType. 135 void setMultiplicativeModifier(ModifierType::Value type, float value); //!< Set the multiplicative modifier for a given ModifierType 136 136 137 std::map<ModifierType:: Enum, float> additiveModifiers_; //!< Map of additive modifiers, indexed by ModifierType.138 std::map<ModifierType:: Enum, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType.137 std::map<ModifierType::Value, float> additiveModifiers_; //!< Map of additive modifiers, indexed by ModifierType. 138 std::map<ModifierType::Value, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType. 139 139 140 140 float duration_; //!< Duration of this pickup's effect (0 for unlimited). -
code/branches/core4/src/orxonox/objects/pickup/ModifierType.h
r3196 r3257 44 44 @brief Gives the available types for modifiers. 45 45 */ 46 enum Enum46 enum Value 47 47 { 48 48 Unknown = 0, -
code/branches/core4/src/orxonox/objects/pickup/PickupCollection.cc
r3239 r3257 42 42 { 43 43 typedef std::pair<std::multimap<std::string, BaseItem*>::iterator, std::multimap<std::string, BaseItem*>::iterator> item_range; 44 typedef std::pair<std::multimap<ModifierType:: Enum, float>::iterator, std::multimap<ModifierType::Enum, float>::iterator> modifier_range;44 typedef std::pair<std::multimap<ModifierType::Value, float>::iterator, std::multimap<ModifierType::Value, float>::iterator> modifier_range; 45 45 46 46 //! Constructor … … 200 200 @param value Value for the modifier. 201 201 */ 202 void PickupCollection::addAdditiveModifier(ModifierType:: Enumtype, float value)203 { 204 this->additiveModifiers_.insert( std::pair<ModifierType:: Enum, float>(type, value) );202 void PickupCollection::addAdditiveModifier(ModifierType::Value type, float value) 203 { 204 this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) ); 205 205 } 206 206 /** … … 209 209 @return Returns the sum of the additive modifiers of the type. 210 210 */ 211 float PickupCollection::getAdditiveModifier(ModifierType:: Enumtype)211 float PickupCollection::getAdditiveModifier(ModifierType::Value type) 212 212 { 213 213 float v = 0.0f; … … 215 215 modifier_range range = this->additiveModifiers_.equal_range(type); 216 216 217 for (std::multimap<ModifierType:: Enum, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)217 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++) 218 218 { 219 219 v += (*it).second; … … 227 227 @param value Value which is to be removed. 228 228 */ 229 void PickupCollection::removeAdditiveModifier(ModifierType:: Enumtype, float value)229 void PickupCollection::removeAdditiveModifier(ModifierType::Value type, float value) 230 230 { 231 231 modifier_range range = this->additiveModifiers_.equal_range(type); 232 for (std::multimap<ModifierType:: Enum, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)232 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++) 233 233 { 234 234 if ((*it).second == value) … … 244 244 @param value Value for the modifier. 245 245 */ 246 void PickupCollection::addMultiplicativeModifier(ModifierType:: Enumtype, float value)247 { 248 this->multiplicativeModifiers_.insert( std::pair<ModifierType:: Enum, float>(type, value) );246 void PickupCollection::addMultiplicativeModifier(ModifierType::Value type, float value) 247 { 248 this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) ); 249 249 } 250 250 /** … … 253 253 @return Returns the product of the multiplicative modifiers of the type. 254 254 */ 255 float PickupCollection::getMultiplicativeModifier(ModifierType:: Enumtype)255 float PickupCollection::getMultiplicativeModifier(ModifierType::Value type) 256 256 { 257 257 float v = 1.0f; 258 258 259 259 modifier_range range = this->multiplicativeModifiers_.equal_range(type); 260 for (std::multimap<ModifierType:: Enum, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)260 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++) 261 261 { 262 262 v *= (*it).second; … … 270 270 @param value Value which is to be removed. 271 271 */ 272 void PickupCollection::removeMultiplicativeModifier(ModifierType:: Enumtype, float value)272 void PickupCollection::removeMultiplicativeModifier(ModifierType::Value type, float value) 273 273 { 274 274 modifier_range range = this->multiplicativeModifiers_.equal_range(type); 275 for (std::multimap<ModifierType:: Enum, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)275 for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++) 276 276 { 277 277 if ((*it).second == value) … … 289 289 @return Returns the value after being processed. 290 290 */ 291 float PickupCollection::processModifiers(ModifierType:: Enumtype, float inputValue, bool addBeforeMultiplication)291 float PickupCollection::processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication) 292 292 { 293 293 float outputValue = inputValue; … … 310 310 @return Returns the value after being processed. 311 311 */ 312 Vector3 PickupCollection::processModifiers(ModifierType:: Enumtype, Vector3 inputValue, bool addBeforeMultiplication)312 Vector3 PickupCollection::processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication) 313 313 { 314 314 Vector3 outputValue = inputValue; -
code/branches/core4/src/orxonox/objects/pickup/PickupCollection.h
r3196 r3257 67 67 void useItem(UsableItem* item); //!< Use a usable item. 68 68 69 void addAdditiveModifier(ModifierType:: Enumtype, float value); //!< Add an additive modifier.70 void addMultiplicativeModifier(ModifierType:: Enumtype, float value); //!< Add a multiplicative modifier.69 void addAdditiveModifier(ModifierType::Value type, float value); //!< Add an additive modifier. 70 void addMultiplicativeModifier(ModifierType::Value type, float value); //!< Add a multiplicative modifier. 71 71 72 float getAdditiveModifier(ModifierType:: Enumtype); //!< Get total additive modifier.73 float getMultiplicativeModifier(ModifierType:: Enumtype); //!< Get total multiplicative modifier.72 float getAdditiveModifier(ModifierType::Value type); //!< Get total additive modifier. 73 float getMultiplicativeModifier(ModifierType::Value type); //!< Get total multiplicative modifier. 74 74 75 void removeAdditiveModifier(ModifierType:: Enumtype, float value); //!< Remove an additive modifier.76 void removeMultiplicativeModifier(ModifierType:: Enumtype, float value); //!< Remove a multiplicative modifier.75 void removeAdditiveModifier(ModifierType::Value type, float value); //!< Remove an additive modifier. 76 void removeMultiplicativeModifier(ModifierType::Value type, float value); //!< Remove a multiplicative modifier. 77 77 78 float processModifiers(ModifierType:: Enumtype, float inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a float.79 Vector3 processModifiers(ModifierType:: Enumtype, Vector3 inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a Vector3.78 float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a float. 79 Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a Vector3. 80 80 81 81 /** … … 113 113 bool bBlockRemovals_; //!< Whether to block direct removals through remove(). 114 114 115 std::multimap<ModifierType:: Enum, float> additiveModifiers_; //!< Contains additive modifiers (indexed by ModifierType).116 std::multimap<ModifierType:: Enum, float> multiplicativeModifiers_; //!< Contains multiplicative modifiers (indexed by ModifierType).115 std::multimap<ModifierType::Value, float> additiveModifiers_; //!< Contains additive modifiers (indexed by ModifierType). 116 std::multimap<ModifierType::Value, float> multiplicativeModifiers_; //!< Contains multiplicative modifiers (indexed by ModifierType). 117 117 118 118 std::multimap<std::string, BaseItem*> items_; //!< Map of items in the collection (indexed by pickupIdentifier of the items). -
code/branches/core4/src/orxonox/objects/quest/GlobalQuest.cc
r3196 r3257 147 147 return false; 148 148 } 149 return (this->isInactive(player) && !(this->status_ == questStatus::completed || this->status_ == questStatus::failed));149 return (this->isInactive(player) && !(this->status_ == QuestStatus::Completed || this->status_ == QuestStatus::Failed)); 150 150 } 151 151 … … 189 189 Throws an Exception if player is NULL. 190 190 */ 191 questStatus::EnumGlobalQuest::getStatus(const PlayerInfo* player) const191 QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const 192 192 { 193 193 if(player == NULL) //!< We don't want NULL-Pointers! … … 203 203 } 204 204 205 return questStatus::inactive;205 return QuestStatus::Inactive; 206 206 } 207 207 … … 217 217 Returns false if player is NULL. 218 218 */ 219 bool GlobalQuest::setStatus(PlayerInfo* player, const questStatus::Enum& status)219 bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) 220 220 { 221 221 if(player == NULL) //!< We don't want NULL-Pointers! -
code/branches/core4/src/orxonox/objects/quest/GlobalQuest.h
r3196 r3257 97 97 virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed. 98 98 99 virtual questStatus::EnumgetStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.99 virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player. 100 100 101 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum& status); //!< Sets the status for a specific player.101 virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player. 102 102 103 103 private: 104 104 std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest. 105 questStatus::Enumstatus_; //!< The status of this Quest.105 QuestStatus::Value status_; //!< The status of this Quest. 106 106 std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest. 107 107 -
code/branches/core4/src/orxonox/objects/quest/LocalQuest.cc
r3196 r3257 176 176 Throws an Exception if player is NULL. 177 177 */ 178 questStatus::EnumLocalQuest::getStatus(const PlayerInfo* player) const178 QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const 179 179 { 180 180 if(player == NULL) //!< No player has no defined status. … … 183 183 } 184 184 185 std::map<const PlayerInfo*, questStatus::Enum>::const_iterator it = this->playerStatus_.find(player);185 std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player); 186 186 if (it != this->playerStatus_.end()) //!< If there is a player in the map. 187 187 { … … 189 189 } 190 190 191 return questStatus::inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.191 return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'. 192 192 } 193 193 … … 203 203 Returns false if player is NULL. 204 204 */ 205 bool LocalQuest::setStatus(PlayerInfo* player, const questStatus::Enum& status)205 bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) 206 206 { 207 207 if(player == NULL) //!< We can't set a status for no player. -
code/branches/core4/src/orxonox/objects/quest/LocalQuest.h
r3196 r3257 91 91 virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed. 92 92 93 virtual questStatus::EnumgetStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.94 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum& status); //!< Sets the status for a specific player.93 virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player. 94 virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player. 95 95 96 96 private: 97 std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.97 std::map<const PlayerInfo*, QuestStatus::Value> playerStatus_; //!< List of the status for each player, with the Player-pointer as key. 98 98 99 99 }; -
code/branches/core4/src/orxonox/objects/quest/Quest.cc
r3196 r3257 302 302 bool Quest::isInactive(const PlayerInfo* player) const 303 303 { 304 return this->getStatus(player) == questStatus::inactive;304 return this->getStatus(player) == QuestStatus::Inactive; 305 305 } 306 306 … … 318 318 { 319 319 320 return this->getStatus(player) == questStatus::active;320 return this->getStatus(player) == QuestStatus::Active; 321 321 } 322 322 … … 333 333 bool Quest::isFailed(const PlayerInfo* player) const 334 334 { 335 return this->getStatus(player) == questStatus::failed;335 return this->getStatus(player) == QuestStatus::Failed; 336 336 } 337 337 … … 348 348 bool Quest::isCompleted(const PlayerInfo* player) const 349 349 { 350 return this->getStatus(player) == questStatus::completed;350 return this->getStatus(player) == QuestStatus::Completed; 351 351 } 352 352 … … 362 362 { 363 363 QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed. 364 this->setStatus(player, questStatus::failed);364 this->setStatus(player, QuestStatus::Failed); 365 365 366 366 COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl; … … 381 381 { 382 382 QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed. 383 this->setStatus(player, questStatus::completed);383 this->setStatus(player, QuestStatus::Completed); 384 384 385 385 COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl; … … 409 409 QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active. 410 410 411 this->setStatus(player, questStatus::active);411 this->setStatus(player, QuestStatus::Active); 412 412 413 413 this->getDescription()->sendAddQuestNotification(); -
code/branches/core4/src/orxonox/objects/quest/Quest.h
r3196 r3257 43 43 namespace orxonox 44 44 { 45 namespace questStatus45 namespace QuestStatus 46 46 { 47 48 47 //!Different states of a Quest. 49 enum Enum48 enum Value 50 49 { 51 inactive,52 active,53 failed,54 completed50 Inactive, 51 Active, 52 Failed, 53 Completed 55 54 }; 56 57 55 } 58 56 … … 133 131 { return this->completeEffects_; } 134 132 135 virtual questStatus::EnumgetStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.136 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum& status) = 0; //!< Changes the status for a specific player.133 virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player. 134 virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player. 137 135 138 136 private: -
code/branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc
r3196 r3257 53 53 RegisterObject(QuestEffectBeacon); 54 54 55 this->status_ = QuestEffectBeaconStatus:: active;55 this->status_ = QuestEffectBeaconStatus::Active; 56 56 this->times_ = INFINITE_TIME; 57 57 } … … 162 162 if(activate) 163 163 { 164 this->status_ = QuestEffectBeaconStatus:: active;165 return true; 166 } 167 168 this->status_ = QuestEffectBeaconStatus:: inactive;164 this->status_ = QuestEffectBeaconStatus::Active; 165 return true; 166 } 167 168 this->status_ = QuestEffectBeaconStatus::Inactive; 169 169 return true; 170 170 } … … 190 190 if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0. 191 191 { 192 this->status_ = QuestEffectBeaconStatus:: inactive;192 this->status_ = QuestEffectBeaconStatus::Inactive; 193 193 } 194 194 -
code/branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h
r3196 r3257 44 44 namespace QuestEffectBeaconStatus 45 45 { 46 47 46 //! The status of the beacon, can be either active or inactive. 48 enum Enum47 enum Value 49 48 { 50 inactive,51 active49 Inactive, 50 Active 52 51 }; 53 54 52 } 55 53 … … 98 96 */ 99 97 inline bool isActive(void) 100 { return this->status_ == QuestEffectBeaconStatus:: active; }98 { return this->status_ == QuestEffectBeaconStatus::Active; } 101 99 102 100 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon. … … 117 115 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 118 116 int times_; //!< Number of times the beacon can be exectued. 119 QuestEffectBeaconStatus:: Enumstatus_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.117 QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive. 120 118 121 119 bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed. -
code/branches/core4/src/orxonox/objects/quest/QuestHint.cc
r3196 r3257 95 95 96 96 //! Find the player. 97 std::map<const PlayerInfo*, questHintStatus::Enum>::const_iterator it = this->playerStatus_.find(player);97 std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player); 98 98 if (it != this->playerStatus_.end()) //!< If the player is in the map. 99 99 { … … 101 101 } 102 102 103 return questStatus::inactive;103 return QuestStatus::Inactive; 104 104 } 105 105 … … 118 118 if(!(this->isActive(player))) //!< If the hint is already active, activation is pointless. 119 119 { 120 this->playerStatus_[player] = questHintStatus::active;120 this->playerStatus_[player] = QuestHintStatus::Active; 121 121 122 122 this->getDescription()->sendAddHintNotification(); -
code/branches/core4/src/orxonox/objects/quest/QuestHint.h
r3196 r3257 42 42 namespace orxonox 43 43 { 44 namespace questHintStatus44 namespace QuestHintStatus 45 45 { 46 47 46 //! The state of the hint. 48 enum Enum47 enum Value 49 48 { 50 inactive,51 active49 Inactive, 50 Active 52 51 }; 53 54 52 } 55 53 … … 91 89 private: 92 90 Quest* quest_; //!< The Quest the QuestHint belongs to. 93 std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.91 std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key. 94 92 95 93 }; -
code/branches/core4/src/orxonox/objects/quest/QuestListener.cc
r3196 r3257 51 51 RegisterObject(QuestListener); 52 52 53 this->mode_ = questListenerMode::all;53 this->mode_ = QuestListenerMode::All; 54 54 this->quest_ = NULL; 55 55 } … … 132 132 if(mode == "all") 133 133 { 134 this->mode_ = questListenerMode::all;134 this->mode_ = QuestListenerMode::All; 135 135 } 136 136 else if(mode == "start") 137 137 { 138 this->mode_ = questListenerMode::start;138 this->mode_ = QuestListenerMode::Start; 139 139 } 140 140 else if(mode == "fail") 141 141 { 142 this->mode_ = questListenerMode::fail;142 this->mode_ = QuestListenerMode::Fail; 143 143 } 144 144 else if(mode == "complete") 145 145 { 146 this->mode_ = questListenerMode::complete;146 this->mode_ = QuestListenerMode::Complete; 147 147 } 148 148 else 149 149 { 150 150 COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl; 151 this->mode_ = questListenerMode::all;151 this->mode_ = QuestListenerMode::All; 152 152 return false; 153 153 } … … 164 164 std::string QuestListener::getMode(void) 165 165 { 166 if(this->mode_ == questListenerMode::all)166 if(this->mode_ == QuestListenerMode::All) 167 167 { 168 168 return "all"; 169 169 } 170 else if(this->mode_ == questListenerMode::start)170 else if(this->mode_ == QuestListenerMode::Start) 171 171 { 172 172 return "start"; 173 173 } 174 else if(this->mode_ == questListenerMode::fail)174 else if(this->mode_ == QuestListenerMode::Fail) 175 175 { 176 176 return "fail"; 177 177 } 178 else if(this->mode_ == questListenerMode::complete)178 else if(this->mode_ == QuestListenerMode::Complete) 179 179 { 180 180 return "complete"; -
code/branches/core4/src/orxonox/objects/quest/QuestListener.h
r3196 r3257 43 43 namespace orxonox 44 44 { 45 namespace questListenerMode45 namespace QuestListenerMode 46 46 { 47 48 47 //! The mode of the QuestListener. 49 enum Enum48 enum Value 50 49 { 51 all,52 start,53 fail,54 complete50 All, 51 Start, 52 Fail, 53 Complete 55 54 }; 56 57 55 } 58 56 … … 93 91 94 92 private: 95 questListenerMode::Enummode_; //!< The mode of the QuestListener.93 QuestListenerMode::Value mode_; //!< The mode of the QuestListener. 96 94 Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to. 97 95 -
code/branches/core4/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc
r3196 r3257 44 44 if (GameMode::showsGraphics()) 45 45 { 46 this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle:: normal);46 this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::Normal); 47 47 this->attachOgreObject(this->particles_->getParticleSystem()); 48 48 this->particles_->setKeepParticlesInLocalSpace(0); -
code/branches/core4/src/orxonox/objects/worldentities/Backlight.cc
r3196 r3257 108 108 void Backlight::registerVariables() 109 109 { 110 registerVariable(this->width_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_width));111 registerVariable(this->lifetime_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime));112 registerVariable(this->length_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_length));113 registerVariable(this->maxelements_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements));114 registerVariable(this->trailmaterial_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial));110 registerVariable(this->width_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_width)); 111 registerVariable(this->lifetime_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime)); 112 registerVariable(this->length_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_length)); 113 registerVariable(this->maxelements_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements)); 114 registerVariable(this->trailmaterial_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial)); 115 115 } 116 116 -
code/branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc
r3239 r3257 56 56 */ 57 57 this->bStop_ = false; 58 this->LOD_ = LODParticle:: normal;58 this->LOD_ = LODParticle::Normal; 59 59 60 60 /* this->stf_ = "setTimeFactor "; … … 307 307 void BigExplosion::registerVariables() 308 308 { 309 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));310 registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));309 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged)); 310 registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop)); 311 311 } 312 312 -
code/branches/core4/src/orxonox/objects/worldentities/BigExplosion.h
r3196 r3257 47 47 void registerVariables(); 48 48 49 inline void setLOD(LODParticle:: LODlevel)49 inline void setLOD(LODParticle::Value level) 50 50 { this->LOD_ = level; this->LODchanged(); } 51 inline LODParticle:: LODgetLOD() const51 inline LODParticle::Value getLOD() const 52 52 { return this->LOD_; } 53 53 … … 98 98 ParticleInterface* explosionFire_; 99 99 100 LODParticle:: LODLOD_;100 LODParticle::Value LOD_; 101 101 Timer<BigExplosion> destroyTimer_; 102 102 }; -
code/branches/core4/src/orxonox/objects/worldentities/Billboard.cc
r3196 r3257 69 69 void Billboard::registerVariables() 70 70 { 71 registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));72 registerVariable(this->colour_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));73 // registerVariable(this->rotation_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));71 registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial)); 72 registerVariable(this->colour_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour)); 73 // registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation)); 74 74 } 75 75 -
code/branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc
r3196 r3257 66 66 void BlinkingBillboard::registerVariables() 67 67 { 68 // registerVariable(this->amplitude_, variableDirection::toclient);69 // registerVariable(this->frequency_, variableDirection::toclient);70 // registerVariable(this->phase_, variableDirection::toclient);68 // registerVariable(this->amplitude_, VariableDirection::ToClient); 69 // registerVariable(this->frequency_, VariableDirection::ToClient); 70 // registerVariable(this->phase_, VariableDirection::ToClient); 71 71 } 72 72 -
code/branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc
r3239 r3257 79 79 80 80 this->setConfigValues(); 81 this->setPriority( priority::very_high );81 this->setPriority( Priority::VeryHigh ); 82 82 this->registerVariables(); 83 83 } … … 238 238 { 239 239 this->client_overwrite_ = this->server_overwrite_; 240 this->setObjectMode( objectDirection::bidirectional);240 this->setObjectMode(ObjectDirection::Bidirectional); 241 241 } 242 242 } … … 254 254 this->bHasLocalController_ = false; 255 255 this->bHasHumanController_ = false; 256 this->setObjectMode( objectDirection::toclient);256 this->setObjectMode(ObjectDirection::ToClient); 257 257 258 258 this->changedPlayer(); … … 368 368 void ControllableEntity::registerVariables() 369 369 { 370 registerVariable(this->cameraPositionTemplate_, variableDirection::toclient);371 registerVariable(this->hudtemplate_, variableDirection::toclient);372 373 registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));374 registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));375 registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));376 registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));377 378 registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));379 registerVariable(this->client_overwrite_, variableDirection::toserver);380 381 registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));382 registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));383 registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));384 registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));370 registerVariable(this->cameraPositionTemplate_, VariableDirection::ToClient); 371 registerVariable(this->hudtemplate_, VariableDirection::ToClient); 372 373 registerVariable(this->server_position_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition)); 374 registerVariable(this->server_linear_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity)); 375 registerVariable(this->server_orientation_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation)); 376 registerVariable(this->server_angular_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity)); 377 378 registerVariable(this->server_overwrite_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite)); 379 registerVariable(this->client_overwrite_, VariableDirection::ToServer); 380 381 registerVariable(this->client_position_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition)); 382 registerVariable(this->client_linear_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity)); 383 registerVariable(this->client_orientation_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation)); 384 registerVariable(this->client_angular_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity)); 385 385 386 386 387 registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));387 registerVariable(this->playerID_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID)); 388 388 } 389 389 -
code/branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc
r3196 r3257 48 48 49 49 this->bStop_ = false; 50 this->LOD_ = LODParticle:: normal;50 this->LOD_ = LODParticle::Normal; 51 51 52 52 if ( GameMode::showsGraphics() ) … … 104 104 void ExplosionChunk::registerVariables() 105 105 { 106 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged));107 registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop));106 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged)); 107 registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop)); 108 108 } 109 109 -
code/branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h
r3196 r3257 46 46 void registerVariables(); 47 47 48 inline void setLOD(LODParticle:: LODlevel)48 inline void setLOD(LODParticle::Value level) 49 49 { this->LOD_ = level; this->LODchanged(); } 50 inline LODParticle:: LODgetLOD() const50 inline LODParticle::Value getLOD() const 51 51 { return this->LOD_; } 52 52 … … 60 60 ParticleInterface* fire_; 61 61 ParticleInterface* smoke_; 62 LODParticle:: LODLOD_;62 LODParticle::Value LOD_; 63 63 Timer<ExplosionChunk> destroyTimer_; 64 64 }; -
code/branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc
r3196 r3257 64 64 void FadingBillboard::registerVariables() 65 65 { 66 registerVariable(this->turnontime_, variableDirection::toclient);67 registerVariable(this->turnofftime_, variableDirection::toclient);66 registerVariable(this->turnontime_, VariableDirection::ToClient); 67 registerVariable(this->turnofftime_, VariableDirection::ToClient); 68 68 } 69 69 -
code/branches/core4/src/orxonox/objects/worldentities/Light.cc
r3250 r3257 45 45 46 46 // Be sure we don't do bad conversions 47 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light:: LT_POINT);48 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light:: LT_DIRECTIONAL);49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light:: LT_SPOTLIGHT);47 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light::Point); 48 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional); 49 BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Spotlight); 50 50 51 51 Light::Light(BaseObject* creator) : StaticEntity(creator) … … 56 56 this->diffuse_ = ColourValue::White; 57 57 this->specular_ = ColourValue::White; 58 this->type_ = Light:: LT_POINT;58 this->type_ = Light::Point; 59 59 this->attenuation_ = Vector4(100000, 1, 0, 0); 60 60 this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f); … … 106 106 void Light::registerVariables() 107 107 { 108 registerVariable((int&)this->type_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateType));109 registerVariable(this->diffuse_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));110 registerVariable(this->specular_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));111 registerVariable(this->attenuation_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateAttenuation));112 registerVariable(this->spotlightRange_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));108 registerVariable((int&)this->type_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType)); 109 registerVariable(this->diffuse_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour)); 110 registerVariable(this->specular_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour)); 111 registerVariable(this->attenuation_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateAttenuation)); 112 registerVariable(this->spotlightRange_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange)); 113 113 } 114 114 … … 127 127 void Light::updateAttenuation() 128 128 { 129 if (this->light_ && this->type_ != Light:: LT_DIRECTIONAL)129 if (this->light_ && this->type_ != Light::Directional) 130 130 this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w); 131 131 } … … 133 133 void Light::updateSpotlightRange() 134 134 { 135 if (this->light_ && this->type_ == Light:: LT_SPOTLIGHT)135 if (this->light_ && this->type_ == Light::Spotlight) 136 136 this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z); 137 137 } … … 140 140 { 141 141 if (type == "point") 142 this->setType(Light:: LT_POINT);142 this->setType(Light::Point); 143 143 else if (type == "directional") 144 this->setType(Light:: LT_DIRECTIONAL);144 this->setType(Light::Directional); 145 145 else if (type == "spotlight") 146 this->setType(Light:: LT_SPOTLIGHT);146 this->setType(Light::Spotlight); 147 147 else 148 this->setType(Light:: LT_POINT);148 this->setType(Light::Point); 149 149 } 150 150 … … 153 153 switch (this->type_) 154 154 { 155 case Light:: LT_DIRECTIONAL:155 case Light::Directional: 156 156 return "directional"; 157 case Light:: LT_SPOTLIGHT:157 case Light::Spotlight: 158 158 return "spotlight"; 159 case Light:: LT_POINT:159 case Light::Point: 160 160 default: 161 161 return "point"; … … 169 169 this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_)); 170 170 171 if (this->type_ != Light:: LT_DIRECTIONAL)171 if (this->type_ != Light::Directional) 172 172 this->updateAttenuation(); 173 if (this->type_ == Light:: LT_SPOTLIGHT)173 if (this->type_ == Light::Spotlight) 174 174 this->updateSpotlightRange(); 175 175 } -
code/branches/core4/src/orxonox/objects/worldentities/Light.h
r3196 r3257 45 45 { 46 46 /// Point light sources give off light equally in all directions, so require only position not direction 47 LT_POINT,47 Point, 48 48 /// Directional lights simulate parallel light beams from a distant source, hence have direction but no position 49 LT_DIRECTIONAL,49 Directional, 50 50 /// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff 51 LT_SPOTLIGHT51 Spotlight 52 52 }; 53 53 -
code/branches/core4/src/orxonox/objects/worldentities/Model.cc
r3196 r3257 65 65 void Model::registerVariables() 66 66 { 67 registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));68 registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));67 registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMesh)); 68 registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedShadows)); 69 69 } 70 70 -
code/branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc
r3239 r3257 52 52 this->continuousResynchroTimer_ = 0; 53 53 54 this->setPriority( priority::low);54 this->setPriority(Priority::Low); 55 55 56 56 this->registerVariables(); … … 89 89 void MovableEntity::registerVariables() 90 90 { 91 registerVariable(this->linearVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));92 registerVariable(this->angularVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity));91 registerVariable(this->linearVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity)); 92 registerVariable(this->angularVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity)); 93 93 94 registerVariable(this->overwrite_position_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));95 registerVariable(this->overwrite_orientation_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));94 registerVariable(this->overwrite_position_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition)); 95 registerVariable(this->overwrite_orientation_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation)); 96 96 } 97 97 -
code/branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc
r3196 r3257 53 53 54 54 this->particles_ = 0; 55 this->LOD_ = LODParticle:: normal;55 this->LOD_ = LODParticle::Normal; 56 56 57 57 this->registerVariables(); … … 71 71 SUPER(ParticleEmitter, XMLPort, xmlelement, mode); 72 72 73 XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle:: normal);73 XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle::Normal); 74 74 XMLPortParam(ParticleEmitter, "source", setSource, getSource, xmlelement, mode); 75 75 } … … 77 77 void ParticleEmitter::registerVariables() 78 78 { 79 registerVariable(this->source_, variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));80 registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));79 registerVariable(this->source_, VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged)); 80 registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged)); 81 81 } 82 82 -
code/branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h
r3196 r3257 57 57 { return this->source_; } 58 58 59 inline void setLOD(LODParticle:: LODlevel)59 inline void setLOD(LODParticle::Value level) 60 60 { this->LOD_ = level; this->LODchanged(); } 61 inline LODParticle:: LODgetLOD() const61 inline LODParticle::Value getLOD() const 62 62 { return this->LOD_; } 63 63 64 64 protected: 65 65 inline void setLODxml(unsigned int level) 66 { this->LOD_ = (LODParticle:: LOD)level; this->LODchanged(); }66 { this->LOD_ = (LODParticle::Value)level; this->LODchanged(); } 67 67 inline unsigned int getLODxml() const 68 68 { return (unsigned int)this->LOD_; } … … 73 73 ParticleInterface* particles_; 74 74 std::string source_; 75 LODParticle:: LODLOD_;75 LODParticle::Value LOD_; 76 76 }; 77 77 } -
code/branches/core4/src/orxonox/objects/worldentities/Planet.cc
r3196 r3257 157 157 void Planet::registerVariables() 158 158 { 159 registerVariable(this->atmosphere_, variableDirection::toclient);160 registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedMesh));161 registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedShadows));162 registerVariable(this->atmosphereSize, variableDirection::toclient);163 registerVariable(this->imageSize, variableDirection::toclient);159 registerVariable(this->atmosphere_, VariableDirection::ToClient); 160 registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh)); 161 registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows)); 162 registerVariable(this->atmosphereSize, VariableDirection::ToClient); 163 registerVariable(this->imageSize, VariableDirection::ToClient); 164 164 } 165 165 -
code/branches/core4/src/orxonox/objects/worldentities/PongBall.cc
r3239 r3257 72 72 registerVariable( this->relMercyOffset_ ); 73 73 registerVariable( this->batID_[0] ); 74 registerVariable( this->batID_[1], variableDirection::toclient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) );74 registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) ); 75 75 } 76 76 -
code/branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc
r3196 r3257 43 43 RegisterObject(StaticEntity); 44 44 45 this->setPriority( priority::very_low);45 this->setPriority(Priority::VeryLow); 46 46 47 47 this->registerVariables(); … … 54 54 void StaticEntity::registerVariables() 55 55 { 56 registerVariable(this->getPosition(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));57 registerVariable(this->getOrientation(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));56 registerVariable(this->getPosition(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged)); 57 registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged)); 58 58 } 59 59 -
code/branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc
r3239 r3257 175 175 void WorldEntity::registerVariables() 176 176 { 177 registerVariable(this->mainStateName_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));178 179 registerVariable(this->bActive_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));180 registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));181 182 registerVariable(this->getScale3D(), variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));177 registerVariable(this->mainStateName_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState)); 178 179 registerVariable(this->bActive_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity)); 180 registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility)); 181 182 registerVariable(this->getScale3D(), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged)); 183 183 184 184 // Physics stuff 185 registerVariable(this->mass_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));186 registerVariable(this->restitution_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));187 registerVariable(this->angularFactor_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));188 registerVariable(this->linearDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));189 registerVariable(this->angularDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));190 registerVariable(this->friction_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));185 registerVariable(this->mass_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged)); 186 registerVariable(this->restitution_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged)); 187 registerVariable(this->angularFactor_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged)); 188 registerVariable(this->linearDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged)); 189 registerVariable(this->angularDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged)); 190 registerVariable(this->friction_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged)); 191 191 registerVariable(this->bCollisionCallbackActive_, 192 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));192 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged)); 193 193 registerVariable(this->bCollisionResponseActive_, 194 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));194 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged)); 195 195 registerVariable((int&)this->collisionTypeSynchronised_, 196 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));196 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged)); 197 197 registerVariable(this->bPhysicsActiveSynchronised_, 198 variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));198 VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged)); 199 199 200 200 // Attach to parent if necessary 201 registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));201 registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged)); 202 202 } 203 203 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc
r3214 r3257 117 117 void Pawn::registerVariables() 118 118 { 119 registerVariable(this->bAlive_, variableDirection::toclient);120 registerVariable(this->health_, variableDirection::toclient);121 registerVariable(this->initialHealth_, variableDirection::toclient);122 registerVariable(this->bReload_, variableDirection::toserver);119 registerVariable(this->bAlive_, VariableDirection::ToClient); 120 registerVariable(this->health_, VariableDirection::ToClient); 121 registerVariable(this->initialHealth_, VariableDirection::ToClient); 122 registerVariable(this->bReload_, VariableDirection::ToServer); 123 123 } 124 124 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r3239 r3257 90 90 void SpaceShip::registerVariables() 91 91 { 92 registerVariable(this->primaryThrust_, variableDirection::toclient);93 registerVariable(this->auxilaryThrust_, variableDirection::toclient);94 registerVariable(this->rotationThrust_, variableDirection::toclient);92 registerVariable(this->primaryThrust_, VariableDirection::ToClient); 93 registerVariable(this->auxilaryThrust_, VariableDirection::ToClient); 94 registerVariable(this->rotationThrust_, VariableDirection::ToClient); 95 95 } 96 96 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc
r3196 r3257 93 93 void Spectator::registerVariables() 94 94 { 95 registerVariable(this->bGreetingFlareVisible_, variableDirection::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));96 registerVariable(this->bGreeting_, variableDirection::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));95 registerVariable(this->bGreetingFlareVisible_, VariableDirection::ToClient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility)); 96 registerVariable(this->bGreeting_, VariableDirection::ToServer, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting)); 97 97 } 98 98 … … 145 145 ControllableEntity::setPlayer(player); 146 146 147 // this->setObjectMode( objectDirection::toclient);147 // this->setObjectMode(ObjectDirection::ToClient); 148 148 } 149 149 -
code/branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc
r3239 r3257 43 43 RegisterObject(TeamBaseMatchBase); 44 44 45 this->state_ = BaseState:: uncontrolled;45 this->state_ = BaseState::Uncontrolled; 46 46 47 47 TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype()); … … 66 66 switch (this->state_) 67 67 { 68 case BaseState:: controlTeam1:68 case BaseState::ControlTeam1: 69 69 colour = gametype->getTeamColour(0); 70 70 break; 71 case BaseState:: controlTeam2:71 case BaseState::ControlTeam2: 72 72 colour = gametype->getTeamColour(1); 73 73 break; 74 case BaseState:: uncontrolled:74 case BaseState::Uncontrolled: 75 75 default: 76 76 colour = ColourValue(0.5, 0.5, 0.5, 1.0); -
code/branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
r3196 r3257 38 38 namespace BaseState 39 39 { 40 enum Enum40 enum Value 41 41 { 42 uncontrolled,43 controlTeam1,44 controlTeam2,42 Uncontrolled, 43 ControlTeam1, 44 ControlTeam2, 45 45 }; 46 46 } … … 58 58 59 59 // Set the state of a base to whatever the argument of the function is 60 void setState(BaseState:: Enumstate)60 void setState(BaseState::Value state) 61 61 { 62 62 this->state_ = state; … … 66 66 67 67 // Get the state of a base as a return value 68 BaseState:: EnumgetState() const68 BaseState::Value getState() const 69 69 { 70 70 return this->state_; … … 75 75 void changeTeamColour(); 76 76 77 BaseState:: Enumstate_;77 BaseState::Value state_; 78 78 }; 79 79 } -
code/branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
r3239 r3257 141 141 } 142 142 143 bool DistanceTrigger::isTriggered(TriggerMode mode)143 bool DistanceTrigger::isTriggered(TriggerMode::Value mode) 144 144 { 145 145 if (Trigger::isTriggered(mode)) -
code/branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
r3196 r3257 59 59 60 60 protected: 61 virtual bool isTriggered(TriggerMode mode);61 virtual bool isTriggered(TriggerMode::Value mode); 62 62 virtual void notifyMaskUpdate() {} 63 63 -
code/branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
r3196 r3257 54 54 } 55 55 56 bool EventTrigger::isTriggered(TriggerMode mode)56 bool EventTrigger::isTriggered(TriggerMode::Value mode) 57 57 { 58 58 if (Trigger::isTriggered(mode)) -
code/branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h
r3196 r3257 47 47 48 48 protected: 49 virtual bool isTriggered(TriggerMode mode);49 virtual bool isTriggered(TriggerMode::Value mode); 50 50 51 51 private: -
code/branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
r3196 r3257 70 70 71 71 protected: 72 virtual bool isTriggered(TriggerMode mode) = 0;72 virtual bool isTriggered(TriggerMode::Value mode) = 0; 73 73 74 74 /** -
code/branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc
r3196 r3257 46 46 RegisterObject(Trigger); 47 47 48 this->mode_ = T M_EventTriggerAND;48 this->mode_ = TriggerMode::EventTriggerAND; 49 49 50 50 this->bFirstTick_ = true; … … 163 163 } 164 164 165 bool Trigger::isTriggered(TriggerMode mode)165 bool Trigger::isTriggered(TriggerMode::Value mode) 166 166 { 167 167 // if (this->bUpdating_) … … 175 175 switch (mode) 176 176 { 177 case T M_EventTriggerAND:177 case TriggerMode::EventTriggerAND: 178 178 returnval = checkAnd(); 179 179 break; 180 case T M_EventTriggerOR:180 case TriggerMode::EventTriggerOR: 181 181 returnval = checkOr(); 182 182 break; 183 case T M_EventTriggerXOR:183 case TriggerMode::EventTriggerXOR: 184 184 returnval = checkXor(); 185 185 break; … … 270 270 { 271 271 if (modeName == "and") 272 this->setMode(T M_EventTriggerAND);272 this->setMode(TriggerMode::EventTriggerAND); 273 273 else if (modeName == "or") 274 this->setMode(T M_EventTriggerOR);274 this->setMode(TriggerMode::EventTriggerOR); 275 275 else if (modeName == "xor") 276 this->setMode(T M_EventTriggerXOR);276 this->setMode(TriggerMode::EventTriggerXOR); 277 277 } 278 278 279 279 std::string Trigger::getModeString() const 280 280 { 281 if (this->mode_ == T M_EventTriggerAND)281 if (this->mode_ == TriggerMode::EventTriggerAND) 282 282 return std::string("and"); 283 else if (this->mode_ == T M_EventTriggerOR)283 else if (this->mode_ == TriggerMode::EventTriggerOR) 284 284 return std::string("or"); 285 else if (this->mode_ == T M_EventTriggerXOR)285 else if (this->mode_ == TriggerMode::EventTriggerXOR) 286 286 return std::string("xor"); 287 287 else -
code/branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h
r3196 r3257 41 41 namespace orxonox 42 42 { 43 enumTriggerMode43 namespace TriggerMode 44 44 { 45 TM_EventTriggerAND, 46 TM_EventTriggerOR, 47 TM_EventTriggerXOR, 48 }; 45 enum Value 46 { 47 EventTriggerAND, 48 EventTriggerOR, 49 EventTriggerXOR, 50 }; 51 } 49 52 50 53 class _OrxonoxExport Trigger : public StaticEntity, public Tickable … … 64 67 65 68 void setMode(const std::string& modeName); 66 inline void setMode(TriggerMode mode)69 inline void setMode(TriggerMode::Value mode) 67 70 { this->mode_ = mode; } 68 inline TriggerMode getMode() const71 inline TriggerMode::Value getMode() const 69 72 { return mode_; } 70 73 … … 103 106 protected: 104 107 inline bool isTriggered() { return this->isTriggered(this->mode_); } 105 virtual bool isTriggered(TriggerMode mode);108 virtual bool isTriggered(TriggerMode::Value mode); 106 109 virtual void triggered(bool bIsTriggered); 107 110 … … 118 121 bool bFirstTick_; 119 122 120 TriggerMode mode_;123 TriggerMode::Value mode_; 121 124 bool bInvertMode_; 122 125 bool bSwitch_;
Note: See TracChangeset
for help on using the changeset viewer.