[Orxonox-commit 727] r3257 - in branches/core4/src: core core/input network network/packet network/synchronisable orxonox orxonox/objects orxonox/objects/collisionshapes orxonox/objects/controllers orxonox/objects/gametypes orxonox/objects/infos orxonox/objects/items orxonox/objects/pickup orxonox/objects/quest orxonox/objects/weaponsystem/projectiles orxonox/objects/worldentities orxonox/objects/worldentities/pawns orxonox/objects/worldentities/triggers orxonox/tools util
rgrieder at orxonox.net
rgrieder at orxonox.net
Tue Jun 30 15:14:47 CEST 2009
Author: rgrieder
Date: 2009-06-30 15:14:45 +0200 (Tue, 30 Jun 2009)
New Revision: 3257
Modified:
branches/core4/src/core/CommandEvaluation.cc
branches/core4/src/core/CommandEvaluation.h
branches/core4/src/core/CommandExecutor.cc
branches/core4/src/core/CommandLine.cc
branches/core4/src/core/CommandLine.h
branches/core4/src/core/ConfigValueContainer.cc
branches/core4/src/core/ConsoleCommand.h
branches/core4/src/core/CorePrereqs.h
branches/core4/src/core/Executor.h
branches/core4/src/core/Functor.h
branches/core4/src/core/input/Button.cc
branches/core4/src/core/input/Button.h
branches/core4/src/network/NetworkPrereqs.h
branches/core4/src/network/packet/Acknowledgement.cc
branches/core4/src/network/packet/Chat.cc
branches/core4/src/network/packet/ClassID.cc
branches/core4/src/network/packet/DeleteObjects.cc
branches/core4/src/network/packet/FunctionCalls.cc
branches/core4/src/network/packet/FunctionIDs.cc
branches/core4/src/network/packet/Gamestate.h
branches/core4/src/network/packet/Packet.cc
branches/core4/src/network/packet/Packet.h
branches/core4/src/network/packet/Welcome.cc
branches/core4/src/network/synchronisable/Synchronisable.cc
branches/core4/src/network/synchronisable/Synchronisable.h
branches/core4/src/network/synchronisable/SynchronisableVariable.h
branches/core4/src/orxonox/OrxonoxPrereqs.h
branches/core4/src/orxonox/objects/GlobalShader.cc
branches/core4/src/orxonox/objects/Level.cc
branches/core4/src/orxonox/objects/Scene.cc
branches/core4/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc
branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc
branches/core4/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc
branches/core4/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
branches/core4/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc
branches/core4/src/orxonox/objects/controllers/ArtificialController.cc
branches/core4/src/orxonox/objects/gametypes/Gametype.h
branches/core4/src/orxonox/objects/gametypes/TeamBaseMatch.cc
branches/core4/src/orxonox/objects/infos/GametypeInfo.cc
branches/core4/src/orxonox/objects/infos/HumanPlayer.cc
branches/core4/src/orxonox/objects/infos/PlayerInfo.cc
branches/core4/src/orxonox/objects/items/Engine.cc
branches/core4/src/orxonox/objects/items/MultiStateEngine.cc
branches/core4/src/orxonox/objects/pickup/ModifierPickup.cc
branches/core4/src/orxonox/objects/pickup/ModifierPickup.h
branches/core4/src/orxonox/objects/pickup/ModifierType.h
branches/core4/src/orxonox/objects/pickup/PickupCollection.cc
branches/core4/src/orxonox/objects/pickup/PickupCollection.h
branches/core4/src/orxonox/objects/quest/GlobalQuest.cc
branches/core4/src/orxonox/objects/quest/GlobalQuest.h
branches/core4/src/orxonox/objects/quest/LocalQuest.cc
branches/core4/src/orxonox/objects/quest/LocalQuest.h
branches/core4/src/orxonox/objects/quest/Quest.cc
branches/core4/src/orxonox/objects/quest/Quest.h
branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc
branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h
branches/core4/src/orxonox/objects/quest/QuestHint.cc
branches/core4/src/orxonox/objects/quest/QuestHint.h
branches/core4/src/orxonox/objects/quest/QuestListener.cc
branches/core4/src/orxonox/objects/quest/QuestListener.h
branches/core4/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc
branches/core4/src/orxonox/objects/worldentities/Backlight.cc
branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc
branches/core4/src/orxonox/objects/worldentities/BigExplosion.h
branches/core4/src/orxonox/objects/worldentities/Billboard.cc
branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc
branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc
branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc
branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h
branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc
branches/core4/src/orxonox/objects/worldentities/Light.cc
branches/core4/src/orxonox/objects/worldentities/Light.h
branches/core4/src/orxonox/objects/worldentities/Model.cc
branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc
branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc
branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h
branches/core4/src/orxonox/objects/worldentities/Planet.cc
branches/core4/src/orxonox/objects/worldentities/PongBall.cc
branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc
branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc
branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc
branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc
branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc
branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h
branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc
branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h
branches/core4/src/orxonox/tools/ParticleInterface.cc
branches/core4/src/orxonox/tools/ParticleInterface.h
branches/core4/src/util/MultiType.cc
branches/core4/src/util/MultiType.h
branches/core4/src/util/MultiTypeValue.h
Log:
Unified enumeration layout according to the style guide (which I have edited recently ;)).
There is one exception though: XMLPort::Mode. Since that would involve 182 changed files, I have decided not to rename it for now. Moreover its syntax is not too bad ;)
Modified: branches/core4/src/core/CommandEvaluation.cc
===================================================================
--- branches/core4/src/core/CommandEvaluation.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CommandEvaluation.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -38,7 +38,7 @@
CommandEvaluation::CommandEvaluation()
{
this->initialize("");
- this->state_ = CS_Uninitialized;
+ this->state_ = CommandState::Uninitialized;
}
void CommandEvaluation::initialize(const std::string& command)
@@ -63,7 +63,7 @@
this->argument_ = "";
this->errorMessage_ = "";
- this->state_ = CS_Empty;
+ this->state_ = CommandState::Empty;
}
bool CommandEvaluation::isValid() const
@@ -103,11 +103,11 @@
{
switch (this->state_)
{
- case CS_Uninitialized:
+ case CommandState::Uninitialized:
break;
- case CS_Empty:
+ case CommandState::Empty:
break;
- case CS_ShortcutOrIdentifier:
+ case CommandState::ShortcutOrIdentifier:
if (this->function_)
{
if (this->function_->getParamCount() == 0)
@@ -118,7 +118,7 @@
else if (this->functionclass_)
return (this->command_ = this->functionclass_->getName() + " ");
break;
- case CS_Function:
+ case CommandState::Function:
if (this->function_)
{
if (this->function_->getParamCount() == 0)
@@ -127,8 +127,8 @@
return (this->command_ = this->functionclass_->getName() + " " + this->function_->getName() + " ");
}
break;
- case CS_ParamPreparation:
- case CS_Params:
+ case CommandState::ParamPreparation:
+ case CommandState::Params:
{
if (this->argument_ == "" && this->possibleArgument_ == "")
break;
@@ -148,9 +148,9 @@
return (this->command_ = this->commandTokens_.subSet(0, maxIndex).join() + " " + this->argument_ + whitespace);
break;
}
- case CS_Finished:
+ case CommandState::Finished:
break;
- case CS_Error:
+ case CommandState::Error:
break;
}
}
@@ -162,10 +162,10 @@
{
switch (this->state_)
{
- case CS_Uninitialized:
+ case CommandState::Uninitialized:
break;
- case CS_Empty:
- case CS_ShortcutOrIdentifier:
+ case CommandState::Empty:
+ case CommandState::ShortcutOrIdentifier:
if (this->listOfPossibleFunctions_.size() == 0)
return CommandEvaluation::dump(this->listOfPossibleIdentifiers_);
else if (this->listOfPossibleIdentifiers_.size() == 0)
@@ -173,20 +173,20 @@
else
return (CommandEvaluation::dump(this->listOfPossibleFunctions_) + "\n" + CommandEvaluation::dump(this->listOfPossibleIdentifiers_));
break;
- case CS_Function:
+ case CommandState::Function:
return CommandEvaluation::dump(this->listOfPossibleFunctions_);
break;
- case CS_ParamPreparation:
- case CS_Params:
+ case CommandState::ParamPreparation:
+ case CommandState::Params:
if (this->listOfPossibleArguments_.size() > 0)
return CommandEvaluation::dump(this->listOfPossibleArguments_);
else
return CommandEvaluation::dump(this->function_);
- case CS_Finished:
+ case CommandState::Finished:
if (this->function_)
return CommandEvaluation::dump(this->function_);
break;
- case CS_Error:
+ case CommandState::Error:
return this->errorMessage_;
break;
}
@@ -199,7 +199,7 @@
this->bEvaluatedParams_ = false;
for (unsigned int i = 0; i < MAX_FUNCTOR_ARGUMENTS; i++)
- this->param_[i] = MT_null;
+ this->param_[i] = MT_Type::Null;
if (!this->isValid())
return;
@@ -229,7 +229,7 @@
if (index < MAX_FUNCTOR_ARGUMENTS)
return this->param_[index];
- return MT_null;
+ return MT_Type::Null;
}
bool CommandEvaluation::hasReturnvalue() const
@@ -237,7 +237,7 @@
if (this->function_)
return this->function_->hasReturnvalue();
- return MT_null;
+ return MT_Type::Null;
}
MultiType CommandEvaluation::getReturnvalue() const
Modified: branches/core4/src/core/CommandEvaluation.h
===================================================================
--- branches/core4/src/core/CommandEvaluation.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CommandEvaluation.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,17 +40,20 @@
namespace orxonox
{
- enum CommandState
+ namespace CommandState
{
- CS_Uninitialized,
- CS_Empty,
- CS_ShortcutOrIdentifier,
- CS_Function,
- CS_ParamPreparation,
- CS_Params,
- CS_Finished,
- CS_Error
- };
+ enum Value
+ {
+ Uninitialized,
+ Empty,
+ ShortcutOrIdentifier,
+ Function,
+ ParamPreparation,
+ Params,
+ Finished,
+ Error
+ };
+ }
class _CoreExport CommandEvaluation
{
@@ -111,7 +114,7 @@
std::string argument_;
std::string errorMessage_;
- CommandState state_;
+ CommandState::Value state_;
bool bEvaluatedParams_;
MultiType param_[5];
Modified: branches/core4/src/core/CommandExecutor.cc
===================================================================
--- branches/core4/src/core/CommandExecutor.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CommandExecutor.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -140,7 +140,7 @@
void CommandExecutor::parseIfNeeded(const std::string& command)
{
- if (CommandExecutor::getEvaluation().state_ == CS_Uninitialized)
+ if (CommandExecutor::getEvaluation().state_ == CommandState::Uninitialized)
{
CommandExecutor::parse(command);
}
@@ -168,12 +168,12 @@
switch (CommandExecutor::getEvaluation().state_)
{
- case CS_Uninitialized:
+ case CommandState::Uninitialized:
{
// Impossible
break;
}
- case CS_Empty:
+ case CommandState::Empty:
{
if (CommandExecutor::argumentsGiven() == 0)
{
@@ -183,11 +183,11 @@
}
else
{
- CommandExecutor::getEvaluation().state_ = CS_ShortcutOrIdentifier;
+ CommandExecutor::getEvaluation().state_ = CommandState::ShortcutOrIdentifier;
// Move on to next case
}
}
- case CS_ShortcutOrIdentifier:
+ case CommandState::ShortcutOrIdentifier:
{
if (CommandExecutor::argumentsGiven() > 1)
{
@@ -198,21 +198,21 @@
if (CommandExecutor::getEvaluation().function_)
{
// It's a shortcut
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
CommandExecutor::getEvaluation().functionclass_ = 0;
// Move on to next case
}
else if (CommandExecutor::getEvaluation().functionclass_)
{
// It's a functionname
- CommandExecutor::getEvaluation().state_ = CS_Function;
+ CommandExecutor::getEvaluation().state_ = CommandState::Function;
CommandExecutor::getEvaluation().function_ = 0;
// Move on to next case
}
else
{
// The first argument is bad
- CommandExecutor::getEvaluation().state_ = CS_Error;
+ CommandExecutor::getEvaluation().state_ = CommandState::Error;
AddLanguageEntry("commandexecutorunknownfirstargument", "is not a shortcut nor a classname");
CommandExecutor::getEvaluation().errorMessage_ = "Error: " + CommandExecutor::getArgument(0) + " " + GetLocalisation("commandexecutorunknownfirstargument") + ".";
return;
@@ -237,7 +237,7 @@
// Unfinished shortcut
CommandExecutor::getEvaluation().bCommandChanged_ = true;
}
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
CommandExecutor::getEvaluation().functionclass_ = 0;
CommandExecutor::getEvaluation().command_ = CommandExecutor::getEvaluation().function_->getName();
if (CommandExecutor::getEvaluation().function_->getParamCount() > 0)
@@ -257,7 +257,7 @@
// Unfinished classname
CommandExecutor::getEvaluation().bCommandChanged_ = true;
}
- CommandExecutor::getEvaluation().state_ = CS_Function;
+ CommandExecutor::getEvaluation().state_ = CommandState::Function;
CommandExecutor::getEvaluation().function_ = 0;
CommandExecutor::getEvaluation().command_ = CommandExecutor::getEvaluation().functionclass_->getName() + " ";
// Move on to next case
@@ -265,7 +265,7 @@
else if (num_identifiers == 0 && num_functions == 0)
{
// No possibilities
- CommandExecutor::getEvaluation().state_ = CS_Error;
+ CommandExecutor::getEvaluation().state_ = CommandState::Error;
AddLanguageEntry("commandexecutorunknownfirstargumentstart", "There is no command or classname starting with");
CommandExecutor::getEvaluation().errorMessage_ = "Error: " + GetLocalisation("commandexecutorunknownfirstargumentstart") + " " + CommandExecutor::getArgument(0) + ".";
return;
@@ -284,7 +284,7 @@
}
}
}
- case CS_Function:
+ case CommandState::Function:
{
if (CommandExecutor::getEvaluation().functionclass_)
{
@@ -297,13 +297,13 @@
if (CommandExecutor::getEvaluation().function_)
{
// It's a function
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
// Move on to next case
}
else
{
// The second argument is bad
- CommandExecutor::getEvaluation().state_ = CS_Error;
+ CommandExecutor::getEvaluation().state_ = CommandState::Error;
AddLanguageEntry("commandexecutorunknownsecondargument", "is not a function of");
CommandExecutor::getEvaluation().errorMessage_ = "Error: " + CommandExecutor::getArgument(1) + " " + GetLocalisation("commandexecutorunknownsecondargument") + " " + CommandExecutor::getEvaluation().functionclass_->getName() + ".";
return;
@@ -325,7 +325,7 @@
// Unfinished function
CommandExecutor::getEvaluation().bCommandChanged_ = true;
}
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
CommandExecutor::getEvaluation().command_ = CommandExecutor::getEvaluation().functionclass_->getName() + " " + CommandExecutor::getEvaluation().function_->getName();
if (CommandExecutor::getEvaluation().function_->getParamCount() > 0)
{
@@ -337,7 +337,7 @@
else if (num_functions == 0)
{
// No possibilities
- CommandExecutor::getEvaluation().state_ = CS_Error;
+ CommandExecutor::getEvaluation().state_ = CommandState::Error;
AddLanguageEntry("commandexecutorunknownsecondargumentstart", "has no function starting with");
CommandExecutor::getEvaluation().errorMessage_ = "Error: " + CommandExecutor::getEvaluation().functionclass_->getName() + " " + GetLocalisation("commandexecutorunknownsecondargumentstart") + " " + CommandExecutor::getArgument(1) + ".";
return;
@@ -354,14 +354,14 @@
}
else
{
- // There is no classname - move on to CS_ParamPreparation
+ // There is no classname - move on to CommandState::ParamPreparation
}
}
- case CS_ParamPreparation:
+ case CommandState::ParamPreparation:
{
if (CommandExecutor::getEvaluation().function_->getParamCount() == 0 || CommandExecutor::enoughArgumentsGiven(CommandExecutor::getEvaluation().function_))
{
- CommandExecutor::getEvaluation().state_ = CS_Finished;
+ CommandExecutor::getEvaluation().state_ = CommandState::Finished;
return;
}
else
@@ -371,7 +371,7 @@
argumentNumber -= 1;
CommandExecutor::createListOfPossibleArguments(CommandExecutor::getLastArgument(), CommandExecutor::getEvaluation().function_, argumentNumber);
- CommandExecutor::getEvaluation().state_ = CS_Params;
+ CommandExecutor::getEvaluation().state_ = CommandState::Params;
if (CommandExecutor::getEvaluation().bCommandChanged_)
{
@@ -380,20 +380,20 @@
}
}
}
- case CS_Params:
+ case CommandState::Params:
{
if (CommandExecutor::getEvaluation().listOfPossibleArguments_.size() == 1)
{
// There is exactly one possible argument
CommandExecutor::getEvaluation().argument_ = (*CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()).getString();
CommandExecutor::getEvaluation().possibleArgument_ = (*CommandExecutor::getEvaluation().listOfPossibleArguments_.begin()).getString();
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
return;
}
else if (CommandExecutor::getEvaluation().listOfPossibleArguments_.size() == 0)
{
// The user tries something new - we let him do
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
CommandExecutor::getEvaluation().argument_ = CommandExecutor::getLastArgument();
return;
}
@@ -408,16 +408,16 @@
CommandExecutor::getEvaluation().argument_ = CommandExecutor::getCommonBegin(CommandExecutor::getEvaluation().listOfPossibleArguments_);
CommandExecutor::getEvaluation().possibleArgument_ = CommandExecutor::getPossibleArgument(CommandExecutor::getLastArgument(), CommandExecutor::getEvaluation().function_, argumentNumber);
- CommandExecutor::getEvaluation().state_ = CS_ParamPreparation;
+ CommandExecutor::getEvaluation().state_ = CommandState::ParamPreparation;
return;
}
}
- case CS_Finished:
+ case CommandState::Finished:
{
// Nothing more to do
break;
}
- case CS_Error:
+ case CommandState::Error:
{
// Bad, very bad
break;
Modified: branches/core4/src/core/CommandLine.cc
===================================================================
--- branches/core4/src/core/CommandLine.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CommandLine.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -53,7 +53,7 @@
{
if (bParsingFile && this->bCommandLineOnly_)
ThrowException(Argument, "Command line argument '" + getName() + "' is not allowed in files.");
- if (value_.getType() == MT_bool)
+ if (value_.getType() == MT_Type::Bool)
{
// simulate command line switch
bool temp;
@@ -294,7 +294,7 @@
else
infoStr << " ";
infoStr << "--" << it->second->getName() << " ";
- if (it->second->getValue().getType() != MT_bool)
+ if (it->second->getValue().getType() != MT_Type::Bool)
infoStr << "ARG ";
else
infoStr << " ";
Modified: branches/core4/src/core/CommandLine.h
===================================================================
--- branches/core4/src/core/CommandLine.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CommandLine.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -212,7 +212,7 @@
{
OrxAssert(!_getInstance().existsArgument(name),
"Cannot add a command line argument with name '" + name + "' twice.");
- OrxAssert(MultiType(defaultValue).getType() != MT_bool || MultiType(defaultValue).getBool() != true,
+ OrxAssert(MultiType(defaultValue).getType() != MT_Type::Bool || MultiType(defaultValue).getBool() != true,
"Boolean command line arguments with positive default values are not supported." << std::endl
<< "Please use SetCommandLineSwitch and adjust your argument: " << name);
Modified: branches/core4/src/core/ConfigValueContainer.cc
===================================================================
--- branches/core4/src/core/ConfigValueContainer.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/ConfigValueContainer.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -77,7 +77,7 @@
for (unsigned int i = 0; i < this->valueVector_.size(); i++)
{
- ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string));
+ ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_Type::String));
this->defvalueStringVector_.push_back(this->valueVector_[i]);
}
@@ -108,7 +108,7 @@
{
if (this->tset(input))
{
- ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isType(MT_string));
+ ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isType(MT_Type::String));
return true;
}
}
@@ -127,7 +127,7 @@
{
if (this->tset(index, input))
{
- ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isType(MT_string));
+ ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isType(MT_Type::String));
return true;
}
}
@@ -227,7 +227,7 @@
// Erase the entry from the vector, change (shift) all entries beginning with index in the config file, remove the last entry from the file
this->valueVector_.erase(this->valueVector_.begin() + index);
for (unsigned int i = index; i < this->valueVector_.size(); i++)
- ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string));
+ ConfigFileManager::getInstance().setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_Type::String));
ConfigFileManager::getInstance().deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size());
return true;
@@ -263,7 +263,7 @@
void ConfigValueContainer::update()
{
if (!this->bIsVector_)
- this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType(MT_string));
+ this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType(MT_Type::String));
else
{
this->valueVector_.clear();
@@ -272,11 +272,11 @@
{
if (i < this->defvalueStringVector_.size())
{
- this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType(MT_string));
+ this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType(MT_Type::String));
}
else
{
- this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, MultiType(), this->value_.isType(MT_string));
+ this->value_ = ConfigFileManager::getInstance().getValue(this->type_, this->sectionname_, this->varname_, i, MultiType(), this->value_.isType(MT_Type::String));
}
this->valueVector_.push_back(this->value_);
Modified: branches/core4/src/core/ConsoleCommand.h
===================================================================
--- branches/core4/src/core/ConsoleCommand.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/ConsoleCommand.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -70,7 +70,7 @@
{
namespace AccessLevel
{
- enum Level
+ enum Value
{
None,
User,
@@ -105,9 +105,9 @@
inline ConsoleCommand& defaultValue(unsigned int index, const MultiType& param)
{ this->Executor::setDefaultValue(index, param); return (*this); }
- inline ConsoleCommand& accessLevel(AccessLevel::Level level)
+ inline ConsoleCommand& accessLevel(AccessLevel::Value level)
{ this->accessLevel_ = level; return (*this); }
- inline AccessLevel::Level getAccessLevel() const
+ inline AccessLevel::Value getAccessLevel() const
{ return this->accessLevel_; }
ConsoleCommand& argumentCompleter(unsigned int param, ArgumentCompleter* completer);
@@ -129,9 +129,9 @@
return *this;
}
- inline ConsoleCommand& keybindMode(KeybindMode::Enum mode)
+ inline ConsoleCommand& keybindMode(KeybindMode::Value mode)
{ this->keybindMode_ = mode; return *this; }
- inline KeybindMode::Enum getKeybindMode() const
+ inline KeybindMode::Value getKeybindMode() const
{ return this->keybindMode_; }
inline ConsoleCommand& inputConfiguredParam(int index)
@@ -140,11 +140,11 @@
{ return this->inputConfiguredParam_; }
private:
- AccessLevel::Level accessLevel_;
+ AccessLevel::Value accessLevel_;
ArgumentCompleter* argumentCompleter_[5];
ArgumentCompletionList argumentList_;
- KeybindMode::Enum keybindMode_;
+ KeybindMode::Value keybindMode_;
int inputConfiguredParam_;
};
Modified: branches/core4/src/core/CorePrereqs.h
===================================================================
--- branches/core4/src/core/CorePrereqs.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/CorePrereqs.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -73,7 +73,7 @@
namespace KeybindMode
{
- enum Enum
+ enum Value
{
OnPress,
OnHold,
Modified: branches/core4/src/core/Executor.h
===================================================================
--- branches/core4/src/core/Executor.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/Executor.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -174,7 +174,7 @@
{ return this->functor_->getParamCount(); }
inline bool hasReturnvalue() const
{ return this->functor_->hasReturnvalue(); }
- inline FunctionType getType() const
+ inline FunctionType::Value getType() const
{ return this->functor_->getType(); }
inline const MultiType& getReturnvalue() const
{ return this->functor_->getReturnvalue(); }
@@ -200,7 +200,7 @@
if (index < MAX_FUNCTOR_ARGUMENTS)
return this->defaultValue_[index];
- return MT_null;
+ return MT_Type::Null;
}
bool allDefaultValuesSet() const;
Modified: branches/core4/src/core/Functor.h
===================================================================
--- branches/core4/src/core/Functor.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/Functor.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,12 +40,15 @@
{
const unsigned int MAX_FUNCTOR_ARGUMENTS = 5;
- enum FunctionType
+ namespace FunctionType
{
- FT_MEMBER,
- FT_CONSTMEMBER,
- FT_STATIC
- };
+ enum Value
+ {
+ Member,
+ ConstMember,
+ Static
+ };
+ }
template <class T>
@@ -97,11 +100,11 @@
Functor() {}
virtual ~Functor() {}
- virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
+ virtual void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
inline unsigned int getParamCount() const { return this->numParams_; }
inline bool hasReturnvalue() const { return this->hasReturnValue_; }
- inline FunctionType getType() const { return this->type_; }
+ inline FunctionType::Value getType() const { return this->type_; }
inline const MultiType& getReturnvalue() const { return this->returnedValue_; }
const std::string& getTypenameParam(unsigned int param) const { return (param < 5) ? this->typeParam_[param] : BLANKSTRING; }
@@ -112,7 +115,7 @@
protected:
unsigned int numParams_;
bool hasReturnValue_;
- FunctionType type_;
+ FunctionType::Value type_;
MultiType returnedValue_;
std::string typeReturnvalue_;
@@ -123,7 +126,7 @@
{
public:
virtual ~FunctorStatic() {}
- virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
+ virtual void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
};
template <class T>
@@ -138,10 +141,10 @@
}
virtual ~FunctorMember() {}
- virtual void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
- virtual void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0;
+ virtual void operator()(T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
+ virtual void operator()(const T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) = 0;
- virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null)
+ virtual void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null)
{
if (this->bConstObject_)
{
@@ -321,14 +324,14 @@
{ \
this->numParams_ = numparams; \
this->hasReturnValue_ = returnvalue; \
- this->type_ = FT_STATIC; \
+ this->type_ = FunctionType::Static; \
this->functionPointer_ = functionPointer; \
\
FUNCTOR_TYPENAME_PARAMS(numparams); \
FUNCTOR_TYPENAME_RETURN(returnvalue); \
} \
\
- void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
+ void operator()(const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) \
{ \
FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
} \
@@ -362,16 +365,16 @@
{ \
this->numParams_ = numparams; \
this->hasReturnValue_ = returnvalue; \
- this->type_ = FT_MEMBER; \
+ this->type_ = FunctionType::Member; \
this->functionPointer_ = functionPointer; \
} \
\
- void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
+ void operator()(T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) \
{ \
FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
} \
\
- void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
+ void operator()(const T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) \
{ \
COUT(1) << "An error occurred in Functor.h:" << std::endl; \
COUT(1) << "Error: Function is not const." << std::endl; \
@@ -395,16 +398,16 @@
{ \
this->numParams_ = numparams; \
this->hasReturnValue_ = returnvalue; \
- this->type_ = FT_CONSTMEMBER; \
+ this->type_ = FunctionType::ConstMember; \
this->functionPointer_ = functionPointer; \
} \
\
- void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
+ void operator()(T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) \
{ \
FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
} \
\
- void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \
+ void operator()(const T* object, const MultiType& param1 = MT_Type::Null, const MultiType& param2 = MT_Type::Null, const MultiType& param3 = MT_Type::Null, const MultiType& param4 = MT_Type::Null, const MultiType& param5 = MT_Type::Null) \
{ \
FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
} \
Modified: branches/core4/src/core/input/Button.cc
===================================================================
--- branches/core4/src/core/input/Button.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/input/Button.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -126,7 +126,7 @@
SubString tokens(commandStrings[iCommand], " ", SubString::WhiteSpaces, false,
'\\', false, '"', false, '(', ')', false, '\0');
- KeybindMode::Enum mode = KeybindMode::None;
+ KeybindMode::Value mode = KeybindMode::None;
float paramModifier = 1.0f;
std::string commandStr = "";
Modified: branches/core4/src/core/input/Button.h
===================================================================
--- branches/core4/src/core/input/Button.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/core/input/Button.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -53,7 +53,7 @@
virtual bool addParamCommand(ParamCommand* command) { return false; }
void parse();
void readConfigValue(ConfigFileType configFile);
- bool execute(KeybindMode::Enum mode, float abs = 1.0f, float rel = 1.0f);
+ bool execute(KeybindMode::Value mode, float abs = 1.0f, float rel = 1.0f);
//! Container to allow for better configValue support
ConfigValueContainer* configContainer_;
@@ -78,7 +78,7 @@
void parseError(std::string message, bool serious);
};
- inline bool Button::execute(KeybindMode::Enum mode, float abs, float rel)
+ inline bool Button::execute(KeybindMode::Value mode, float abs, float rel)
{
// execute all the parsed commands in the string
for (unsigned int iCommand = 0; iCommand < nCommands_[mode]; iCommand++)
Modified: branches/core4/src/network/NetworkPrereqs.h
===================================================================
--- branches/core4/src/network/NetworkPrereqs.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/NetworkPrereqs.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -131,7 +131,7 @@
namespace PacketFlag
{
- enum Enum
+ enum Value
{
Reliable = 1,
Unsequence = 2,
Modified: branches/core4/src/network/packet/Acknowledgement.cc
===================================================================
--- branches/core4/src/network/packet/Acknowledgement.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Acknowledgement.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -36,14 +36,14 @@
#define PACKET_FLAGS_ACK 0
#define _PACKETID 0
-#define _ACKID _PACKETID + sizeof(packet::ENUM::Type)
+#define _ACKID _PACKETID + sizeof(packet::Type::Value)
Acknowledgement::Acknowledgement( unsigned int id, unsigned int clientID )
: Packet()
{
flags_ = flags_ | PACKET_FLAGS_ACK;
data_=new uint8_t[ getSize() ];
- *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::Acknowledgement;
+ *(Type::Value *)(data_ + _PACKETID ) = Type::Acknowledgement;
*(uint32_t *)(data_ + _ACKID ) = id;
clientID_=clientID;
}
Modified: branches/core4/src/network/packet/Chat.cc
===================================================================
--- branches/core4/src/network/packet/Chat.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Chat.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -37,7 +37,7 @@
#define PACKET_FLAGS_CHAT PacketFlag::Reliable
#define _PACKETID 0
-const int _PLAYERID = _PACKETID + sizeof(ENUM::Type);
+const int _PLAYERID = _PACKETID + sizeof(Type::Value);
#define _MESSAGELENGTH _PLAYERID + sizeof(uint32_t)
#define _MESSAGE _MESSAGELENGTH + sizeof(uint32_t)
@@ -47,7 +47,7 @@
flags_ = flags_ | PACKET_FLAGS_CHAT;
messageLength_ = message.length()+1;
data_=new unsigned char[ getSize() ];
- *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::Chat;
+ *(Type::Value *)(data_ + _PACKETID ) = Type::Chat;
*(unsigned int *)(data_ + _PLAYERID ) = playerID;
*(unsigned int *)(data_ + _MESSAGELENGTH ) = messageLength_;
memcpy( data_+_MESSAGE, (void *)message.c_str(), messageLength_ );
Modified: branches/core4/src/network/packet/ClassID.cc
===================================================================
--- branches/core4/src/network/packet/ClassID.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/ClassID.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -73,7 +73,7 @@
this->data_=new uint8_t[ packetSize ];
//set the appropriate packet id
assert(this->data_);
- *(ENUM::Type *)(this->data_ + _PACKETID ) = ENUM::ClassID;
+ *(Type::Value *)(this->data_ + _PACKETID ) = Type::ClassID;
uint8_t *temp=data_+sizeof(uint32_t);
// save the number of all classes
Modified: branches/core4/src/network/packet/DeleteObjects.cc
===================================================================
--- branches/core4/src/network/packet/DeleteObjects.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/DeleteObjects.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -38,7 +38,7 @@
#define PACKET_FLAG_DELETE PacketFlag::Reliable
#define _PACKETID 0
-#define _QUANTITY _PACKETID + sizeof(ENUM::Type)
+#define _QUANTITY _PACKETID + sizeof(Type::Value)
#define _OBJECTIDS _QUANTITY + sizeof(uint32_t)
DeleteObjects::DeleteObjects()
@@ -61,11 +61,11 @@
if(number==0)
return false;
COUT(4) << "sending DeleteObjects: ";
- unsigned int size = sizeof(ENUM::Type) + sizeof(uint32_t)*(number+1);
+ unsigned int size = sizeof(Type::Value) + sizeof(uint32_t)*(number+1);
data_ = new uint8_t[size];
uint8_t *tdata = data_;
- *reinterpret_cast<ENUM::Type*>(tdata) = ENUM::DeleteObjects;
- tdata += sizeof(ENUM::Type);
+ *reinterpret_cast<Type::Value*>(tdata) = Type::DeleteObjects;
+ tdata += sizeof(Type::Value);
*(uint32_t *)tdata = number;
tdata += sizeof(uint32_t);
for(unsigned int i=0; i<number; i++){
Modified: branches/core4/src/network/packet/FunctionCalls.cc
===================================================================
--- branches/core4/src/network/packet/FunctionCalls.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/FunctionCalls.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -48,7 +48,7 @@
nrOfCalls_ = 0;
currentMemBlocks_ = 1;
data_=new uint8_t[ FUNCTIONCALLS_MEM_ALLOCATION ];
- *(ENUM::Type *)(data_ + _PACKETID ) = ENUM::FunctionCalls;
+ *(Type::Value *)(data_ + _PACKETID ) = Type::FunctionCalls;
*(uint32_t*)(data_+sizeof(uint32_t)) = 0; // set nrOfCalls to 0
}
Modified: branches/core4/src/network/packet/FunctionIDs.cc
===================================================================
--- branches/core4/src/network/packet/FunctionIDs.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/FunctionIDs.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -67,7 +67,7 @@
this->data_=new uint8_t[ packetSize ];
//set the appropriate packet id
assert(this->data_);
- *(ENUM::Type *)(this->data_ + _PACKETID ) = ENUM::FunctionIDs;
+ *(Type::Value *)(this->data_ + _PACKETID ) = Type::FunctionIDs;
uint8_t *temp=data_+sizeof(uint32_t);
// save the number of all classes
Modified: branches/core4/src/network/packet/Gamestate.h
===================================================================
--- branches/core4/src/network/packet/Gamestate.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Gamestate.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -46,7 +46,7 @@
class _NetworkExport GamestateHeader{
public:
- GamestateHeader(uint8_t *data){ assert(data); data_ = data; *(uint32_t*)data_ = ENUM::Gamestate; }
+ GamestateHeader(uint8_t *data){ assert(data); data_ = data; *(uint32_t*)data_ = Type::Gamestate; }
GamestateHeader(uint8_t *data, GamestateHeader* h)
{ assert(data); data_=data; memcpy(data_, h->data_, getSize()); }
static inline uint32_t getSize()
Modified: branches/core4/src/network/packet/Packet.cc
===================================================================
--- branches/core4/src/network/packet/Packet.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Packet.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -62,7 +62,7 @@
Packet::Packet(){
flags_ = PACKET_FLAG_DEFAULT;
- packetDirection_ = ENUM::Outgoing;
+ packetDirection_ = Direction::Outgoing;
clientID_=0;
data_=0;
enetPacket_=0;
@@ -75,7 +75,7 @@
Packet::Packet(uint8_t *data, unsigned int clientID){
flags_ = PACKET_FLAG_DEFAULT;
- packetDirection_ = ENUM::Incoming;
+ packetDirection_ = Direction::Incoming;
clientID_=clientID;
data_=data;
enetPacket_=0;
@@ -124,7 +124,7 @@
}
bool Packet::send(){
- if(packetDirection_ != ENUM::Outgoing && packetDirection_ != ENUM::Bidirectional ){
+ if(packetDirection_ != Direction::Outgoing && packetDirection_ != Direction::Bidirectional ){
assert(0);
return false;
}
@@ -146,16 +146,16 @@
}
}
#ifndef NDEBUG
- switch( *(ENUM::Type *)(data_ + _PACKETID) )
+ switch( *(Type::Value *)(data_ + _PACKETID) )
{
- case ENUM::Acknowledgement:
- case ENUM::Chat:
- case ENUM::ClassID:
- case ENUM::Gamestate:
- case ENUM::Welcome:
- case ENUM::DeleteObjects:
- case ENUM::FunctionIDs:
- case ENUM::FunctionCalls:
+ case Type::Acknowledgement:
+ case Type::Chat:
+ case Type::ClassID:
+ case Type::Gamestate:
+ case Type::Welcome:
+ case Type::DeleteObjects:
+ case Type::FunctionIDs:
+ case Type::FunctionCalls:
break;
default:
assert(0); //there was some error, if this is the case
@@ -174,39 +174,39 @@
assert(ClientInformation::findClient(&peer->address)->getID() != (unsigned int)-2 || !Host::isServer());
unsigned int clientID = ClientInformation::findClient(&peer->address)->getID();
Packet *p = 0;
- COUT(6) << "packet type: " << *(ENUM::Type *)&data[_PACKETID] << std::endl;
- switch( *(ENUM::Type *)(data + _PACKETID) )
+ COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;
+ switch( *(Type::Value *)(data + _PACKETID) )
{
- case ENUM::Acknowledgement:
+ case Type::Acknowledgement:
COUT(5) << "ack" << std::endl;
p = new Acknowledgement( data, clientID );
break;
- case ENUM::Chat:
+ case Type::Chat:
COUT(5) << "chat" << std::endl;
p = new Chat( data, clientID );
break;
- case ENUM::ClassID:
+ case Type::ClassID:
COUT(5) << "classid" << std::endl;
p = new ClassID( data, clientID );
break;
- case ENUM::Gamestate:
+ case Type::Gamestate:
COUT(5) << "gamestate" << std::endl;
// TODO: remove brackets
p = new Gamestate( data, clientID );
break;
- case ENUM::Welcome:
+ case Type::Welcome:
COUT(5) << "welcome" << std::endl;
p = new Welcome( data, clientID );
break;
- case ENUM::DeleteObjects:
+ case Type::DeleteObjects:
COUT(5) << "deleteobjects" << std::endl;
p = new DeleteObjects( data, clientID );
break;
- case ENUM::FunctionCalls:
+ case Type::FunctionCalls:
COUT(5) << "functionCalls" << std::endl;
p = new FunctionCalls( data, clientID );
break;
- case ENUM::FunctionIDs:
+ case Type::FunctionIDs:
COUT(5) << "functionIDs" << std::endl;
p = new FunctionIDs( data, clientID );
break;
Modified: branches/core4/src/network/packet/Packet.h
===================================================================
--- branches/core4/src/network/packet/Packet.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Packet.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -35,13 +35,15 @@
namespace packet{
-namespace ENUM{
- enum Direction{
+namespace Direction{
+ enum Value{
Incoming,
Outgoing,
Bidirectional
};
- enum Type{
+}
+namespace Type{
+ enum Value{
Acknowledgement,
Chat,
ClassID,
@@ -83,7 +85,7 @@
uint32_t flags_;
unsigned int clientID_;
- ENUM::Direction packetDirection_;
+ Direction::Value packetDirection_;
/** Pointer to the data. Be careful when deleting it because it might
point to a location that was allocated by ENet.
See bDataENetAllocated_ */
Modified: branches/core4/src/network/packet/Welcome.cc
===================================================================
--- branches/core4/src/network/packet/Welcome.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/packet/Welcome.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,7 +40,7 @@
#define PACKET_FLAGS_CLASSID PacketFlag::Reliable
#define _PACKETID 0
-#define _CLIENTID _PACKETID + sizeof(ENUM::Type)
+#define _CLIENTID _PACKETID + sizeof(Type::Value)
#define _ENDIANTEST _CLIENTID + sizeof(uint32_t)
Welcome::Welcome( uint32_t clientID, uint32_t shipID )
@@ -50,7 +50,7 @@
assert(getSize());
data_=new uint8_t[ getSize() ];
assert(data_);
- *(packet::ENUM::Type *)(data_ + _PACKETID ) = packet::ENUM::Welcome;
+ *(packet::Type::Value *)(data_ + _PACKETID ) = packet::Type::Welcome;
*(uint32_t *)(data_ + _CLIENTID ) = static_cast<uint32_t>(clientID);
*(uint32_t *)(data_ + _ENDIANTEST ) = 0xFEDC4321;
}
@@ -69,7 +69,7 @@
}
unsigned int Welcome::getSize() const{
- return sizeof(packet::ENUM::Type) + 2*sizeof(uint32_t);
+ return sizeof(packet::Type::Value) + 2*sizeof(uint32_t);
}
bool Welcome::process(){
Modified: branches/core4/src/network/synchronisable/Synchronisable.cc
===================================================================
--- branches/core4/src/network/synchronisable/Synchronisable.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/synchronisable/Synchronisable.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -64,7 +64,7 @@
// set dataSize to 0
this->dataSize_ = 0;
// set standard priority
- this->setPriority( priority::normal );
+ this->setPriority( Priority::Normal );
// get creator id
this->creatorID = OBJECTID_UNKNOWN;
Modified: branches/core4/src/network/synchronisable/Synchronisable.h
===================================================================
--- branches/core4/src/network/synchronisable/Synchronisable.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/synchronisable/Synchronisable.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -50,21 +50,21 @@
namespace orxonox
{
- namespace objectDirection{
- enum objectdirection{
- toclient=0x1,
- toserver=0x2,
- bidirectional=0x3
+ namespace ObjectDirection{
+ enum Value{
+ ToClient=0x1,
+ ToServer=0x2,
+ Bidirectional=0x3
};
}
- namespace priority{
- enum prio{
- very_high = -100,
- high = -15,
- normal = 0,
- low = 15,
- very_low = 100
+ namespace Priority{
+ enum Value{
+ VeryHigh = -100,
+ High = -15,
+ Normal = 0,
+ Low = 15,
+ VeryLow = 100
};
}
Modified: branches/core4/src/network/synchronisable/SynchronisableVariable.h
===================================================================
--- branches/core4/src/network/synchronisable/SynchronisableVariable.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/network/synchronisable/SynchronisableVariable.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,14 +40,16 @@
namespace orxonox{
- namespace variableDirection{
- enum syncdirection{
- toclient=0x1,
- toserver=0x2
+ namespace VariableDirection{
+ enum Value{
+ ToClient=0x1,
+ ToServer=0x2
};
- enum bidirectional{
- serverMaster=0x1,
- clientMaster=0x2
+ }
+ namespace Bidirectionality{
+ enum Value{
+ ServerMaster=0x1,
+ ClientMaster=0x2
};
}
@@ -68,7 +70,7 @@
class SynchronisableVariable: public SynchronisableVariableBase
{
public:
- SynchronisableVariable(T& variable, uint8_t syncDirection=variableDirection::toclient, NetworkCallbackBase *cb=0);
+ SynchronisableVariable(T& variable, uint8_t syncDirection=VariableDirection::ToClient, NetworkCallbackBase *cb=0);
virtual ~SynchronisableVariable();
virtual inline uint8_t getMode(){ return mode_; }
@@ -87,7 +89,7 @@
class SynchronisableVariableBidirectional: public SynchronisableVariable<T>
{
public:
- SynchronisableVariableBidirectional(T& variable, uint8_t master=variableDirection::serverMaster, NetworkCallbackBase *cb=0);
+ SynchronisableVariableBidirectional(T& variable, uint8_t master=Bidirectionality::ServerMaster, NetworkCallbackBase *cb=0);
virtual ~SynchronisableVariableBidirectional();
virtual inline uint8_t getMode(){ return 0x3; } //this basically is a hack ^^
Modified: branches/core4/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- branches/core4/src/orxonox/OrxonoxPrereqs.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/OrxonoxPrereqs.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -64,12 +64,12 @@
{
namespace LODParticle
{
- enum LOD
+ enum Value
{
- off = 0,
- low = 1,
- normal = 2,
- high = 3
+ Off = 0,
+ Low = 1,
+ Normal = 2,
+ High = 3
};
}
Modified: branches/core4/src/orxonox/objects/GlobalShader.cc
===================================================================
--- branches/core4/src/orxonox/objects/GlobalShader.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/GlobalShader.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -65,8 +65,8 @@
void GlobalShader::registerVariables()
{
- registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility));
- registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), variableDirection::toclient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor));
+ registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<GlobalShader>(this, &GlobalShader::changedVisibility));
+ registerVariable(const_cast<std::string&>(this->shader_.getCompositor()), VariableDirection::ToClient, new NetworkCallback<Shader>(&this->shader_, &Shader::changedCompositor));
}
void GlobalShader::changedVisibility()
Modified: branches/core4/src/orxonox/objects/Level.cc
===================================================================
--- branches/core4/src/orxonox/objects/Level.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/Level.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -86,9 +86,9 @@
void Level::registerVariables()
{
- registerVariable(this->xmlfilename_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
- registerVariable(this->name_, variableDirection::toclient, new NetworkCallback<Level>(this, &Level::changedName));
- registerVariable(this->description_, variableDirection::toclient);
+ registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile));
+ registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName));
+ registerVariable(this->description_, VariableDirection::ToClient);
}
void Level::networkcallback_applyXMLFile()
Modified: branches/core4/src/orxonox/objects/Scene.cc
===================================================================
--- branches/core4/src/orxonox/objects/Scene.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/Scene.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -114,13 +114,13 @@
void Scene::registerVariables()
{
- registerVariable(this->skybox_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
- registerVariable(this->ambientLight_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
- registerVariable(this->negativeWorldRange_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_negativeWorldRange));
- registerVariable(this->positiveWorldRange_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_positiveWorldRange));
- registerVariable(this->gravity_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_gravity));
- registerVariable(this->bHasPhysics_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));
- registerVariable(this->bShadows_, variableDirection::toclient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));
+ registerVariable(this->skybox_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applySkybox));
+ registerVariable(this->ambientLight_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyAmbientLight));
+ registerVariable(this->negativeWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_negativeWorldRange));
+ registerVariable(this->positiveWorldRange_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_positiveWorldRange));
+ registerVariable(this->gravity_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_gravity));
+ registerVariable(this->bHasPhysics_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_hasPhysics));
+ registerVariable(this->bShadows_, VariableDirection::ToClient, new NetworkCallback<Scene>(this, &Scene::networkcallback_applyShadows));
}
void Scene::setNegativeWorldRange(const Vector3& range)
Modified: branches/core4/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc
===================================================================
--- branches/core4/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/collisionshapes/BoxCollisionShape.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -56,7 +56,7 @@
void BoxCollisionShape::registerVariables()
{
- registerVariable(this->halfExtents_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->halfExtents_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
}
void BoxCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc
===================================================================
--- branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/collisionshapes/CollisionShape.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -76,7 +76,7 @@
void CollisionShape::registerVariables()
{
- registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged));
+ registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged));
}
void CollisionShape::parentChanged()
Modified: branches/core4/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc
===================================================================
--- branches/core4/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/collisionshapes/ConeCollisionShape.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -56,8 +56,8 @@
void ConeCollisionShape::registerVariables()
{
- registerVariable(this->radius_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
- registerVariable(this->height_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->radius_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->height_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
}
void ConeCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: branches/core4/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc
===================================================================
--- branches/core4/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/collisionshapes/PlaneCollisionShape.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -57,8 +57,8 @@
void PlaneCollisionShape::registerVariables()
{
- registerVariable(this->normal_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
- registerVariable(this->offset_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->normal_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->offset_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
}
void PlaneCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: branches/core4/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc
===================================================================
--- branches/core4/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/collisionshapes/SphereCollisionShape.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -55,7 +55,7 @@
void SphereCollisionShape::registerVariables()
{
- registerVariable(this->radius_, variableDirection::toclient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
+ registerVariable(this->radius_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape));
}
void SphereCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)
Modified: branches/core4/src/orxonox/objects/controllers/ArtificialController.cc
===================================================================
--- branches/core4/src/orxonox/objects/controllers/ArtificialController.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/controllers/ArtificialController.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -207,13 +207,13 @@
{
switch (base->getState())
{
- case BaseState::controlTeam1:
+ case BaseState::ControlTeam1:
team1 = 0;
break;
- case BaseState::controlTeam2:
+ case BaseState::ControlTeam2:
team1 = 1;
break;
- case BaseState::uncontrolled:
+ case BaseState::Uncontrolled:
default:
team1 = -1;
}
@@ -223,13 +223,13 @@
{
switch (base->getState())
{
- case BaseState::controlTeam1:
+ case BaseState::ControlTeam1:
team2 = 0;
break;
- case BaseState::controlTeam2:
+ case BaseState::ControlTeam2:
team2 = 1;
break;
- case BaseState::uncontrolled:
+ case BaseState::Uncontrolled:
default:
team2 = -1;
}
Modified: branches/core4/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- branches/core4/src/orxonox/objects/gametypes/Gametype.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/gametypes/Gametype.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -44,7 +44,7 @@
{
namespace PlayerState
{
- enum Enum
+ enum Value
{
Uninitialized,
Joined,
@@ -56,7 +56,7 @@
struct Player
{
PlayerInfo* info_;
- PlayerState::Enum state_;
+ PlayerState::Value state_;
int frags_;
int killed_;
};
Modified: branches/core4/src/orxonox/objects/gametypes/TeamBaseMatch.cc
===================================================================
--- branches/core4/src/orxonox/objects/gametypes/TeamBaseMatch.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/gametypes/TeamBaseMatch.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -65,12 +65,12 @@
int teamnr = this->getTeam(originator->getPlayer());
if (teamnr == 0)
{
- base->setState(BaseState::controlTeam1);
+ base->setState(BaseState::ControlTeam1);
this->gtinfo_.sendAnnounceMessage("The red team captured a base");
}
if (teamnr == 1)
{
- base->setState(BaseState::controlTeam2);
+ base->setState(BaseState::ControlTeam2);
this->gtinfo_.sendAnnounceMessage("The blue team captured a base");
}
}
@@ -106,13 +106,13 @@
switch (base->getState())
{
- case BaseState::controlTeam1:
+ case BaseState::ControlTeam1:
teamnrbase = 0;
break;
- case BaseState::controlTeam2:
+ case BaseState::ControlTeam2:
teamnrbase = 1;
break;
- case BaseState::uncontrolled:
+ case BaseState::Uncontrolled:
default:
teamnrbase = -1;
}
@@ -154,11 +154,11 @@
for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
{
- if((*it)->getState() == BaseState::controlTeam1)
+ if((*it)->getState() == BaseState::ControlTeam1)
{
amountControlled++;
}
- if((*it)->getState() == BaseState::controlTeam2)
+ if((*it)->getState() == BaseState::ControlTeam2)
{
amountControlled2++;
}
@@ -240,9 +240,9 @@
for (std::set<TeamBaseMatchBase*>::const_iterator it = this->bases_.begin(); it != this->bases_.end(); ++it)
{
- if ((*it)->getState() == BaseState::controlTeam1 && team == 0)
+ if ((*it)->getState() == BaseState::ControlTeam1 && team == 0)
count++;
- if ((*it)->getState() == BaseState::controlTeam2 && team == 1)
+ if ((*it)->getState() == BaseState::ControlTeam2 && team == 1)
count++;
}
@@ -252,7 +252,7 @@
void TeamBaseMatch::addBase(TeamBaseMatchBase* base)
{
this->bases_.insert(base);
- base->setState(BaseState::uncontrolled);
+ base->setState(BaseState::Uncontrolled);
}
TeamBaseMatchBase* TeamBaseMatch::getBase(unsigned int index) const
Modified: branches/core4/src/orxonox/objects/infos/GametypeInfo.cc
===================================================================
--- branches/core4/src/orxonox/objects/infos/GametypeInfo.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/infos/GametypeInfo.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -60,11 +60,11 @@
void GametypeInfo::registerVariables()
{
- registerVariable(this->bStarted_, variableDirection::toclient);
- registerVariable(this->bEnded_, variableDirection::toclient);
- registerVariable(this->startCountdown_, variableDirection::toclient);
- registerVariable(this->bStartCountdownRunning_, variableDirection::toclient);
- registerVariable(this->hudtemplate_, variableDirection::toclient);
+ registerVariable(this->bStarted_, VariableDirection::ToClient);
+ registerVariable(this->bEnded_, VariableDirection::ToClient);
+ registerVariable(this->startCountdown_, VariableDirection::ToClient);
+ registerVariable(this->bStartCountdownRunning_, VariableDirection::ToClient);
+ registerVariable(this->hudtemplate_, VariableDirection::ToClient);
}
void GametypeInfo::sendAnnounceMessage(const std::string& message)
Modified: branches/core4/src/orxonox/objects/infos/HumanPlayer.cc
===================================================================
--- branches/core4/src/orxonox/objects/infos/HumanPlayer.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/infos/HumanPlayer.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -78,11 +78,11 @@
void HumanPlayer::registerVariables()
{
- registerVariable(this->synchronize_nick_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
+ registerVariable(this->synchronize_nick_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
- registerVariable(this->clientID_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
- registerVariable(this->server_initialized_, variableDirection::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
- registerVariable(this->client_initialized_, variableDirection::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
+ registerVariable(this->clientID_, VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
+ registerVariable(this->server_initialized_, VariableDirection::ToClient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
+ registerVariable(this->client_initialized_, VariableDirection::ToServer, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
}
void HumanPlayer::configvaluecallback_changednick()
@@ -115,7 +115,7 @@
this->client_initialized_ = true;
if (!GameMode::isMaster())
- this->setObjectMode(objectDirection::bidirectional);
+ this->setObjectMode(ObjectDirection::Bidirectional);
else
this->setName(this->nick_);
Modified: branches/core4/src/orxonox/objects/infos/PlayerInfo.cc
===================================================================
--- branches/core4/src/orxonox/objects/infos/PlayerInfo.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/infos/PlayerInfo.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -76,10 +76,10 @@
void PlayerInfo::registerVariables()
{
- registerVariable(this->name_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
- registerVariable(this->controllableEntityID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
- registerVariable(this->bReadyToSpawn_, variableDirection::toserver);
- registerVariable(this->gtinfoID_, variableDirection::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));
+ registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
+ registerVariable(this->controllableEntityID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
+ registerVariable(this->bReadyToSpawn_, VariableDirection::ToServer);
+ registerVariable(this->gtinfoID_, VariableDirection::ToClient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedgtinfoID));
}
void PlayerInfo::changedName()
Modified: branches/core4/src/orxonox/objects/items/Engine.cc
===================================================================
--- branches/core4/src/orxonox/objects/items/Engine.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/items/Engine.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -112,21 +112,21 @@
void Engine::registerVariables()
{
- registerVariable(this->shipID_, variableDirection::toclient, new NetworkCallback<Engine>(this, &Engine::networkcallback_shipID));
+ registerVariable(this->shipID_, VariableDirection::ToClient, new NetworkCallback<Engine>(this, &Engine::networkcallback_shipID));
- registerVariable(this->speedFactor_, variableDirection::toclient);
- registerVariable(this->boostFactor_, variableDirection::toclient);
+ registerVariable(this->speedFactor_, VariableDirection::ToClient);
+ registerVariable(this->boostFactor_, VariableDirection::ToClient);
- registerVariable(this->maxSpeedFront_, variableDirection::toclient);
- registerVariable(this->maxSpeedBack_, variableDirection::toclient);
- registerVariable(this->maxSpeedLeftRight_, variableDirection::toclient);
- registerVariable(this->maxSpeedUpDown_, variableDirection::toclient);
+ registerVariable(this->maxSpeedFront_, VariableDirection::ToClient);
+ registerVariable(this->maxSpeedBack_, VariableDirection::ToClient);
+ registerVariable(this->maxSpeedLeftRight_, VariableDirection::ToClient);
+ registerVariable(this->maxSpeedUpDown_, VariableDirection::ToClient);
- registerVariable(this->accelerationFront_, variableDirection::toclient);
- registerVariable(this->accelerationBrake_, variableDirection::toclient);
- registerVariable(this->accelerationBack_, variableDirection::toclient);
- registerVariable(this->accelerationLeftRight_, variableDirection::toclient);
- registerVariable(this->accelerationUpDown_, variableDirection::toclient);
+ registerVariable(this->accelerationFront_, VariableDirection::ToClient);
+ registerVariable(this->accelerationBrake_, VariableDirection::ToClient);
+ registerVariable(this->accelerationBack_, VariableDirection::ToClient);
+ registerVariable(this->accelerationLeftRight_, VariableDirection::ToClient);
+ registerVariable(this->accelerationUpDown_, VariableDirection::ToClient);
}
void Engine::networkcallback_shipID()
Modified: branches/core4/src/orxonox/objects/items/MultiStateEngine.cc
===================================================================
--- branches/core4/src/orxonox/objects/items/MultiStateEngine.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/items/MultiStateEngine.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -81,7 +81,7 @@
void MultiStateEngine::registerVariables()
{
- registerVariable(this->state_, variableDirection::toserver);
+ registerVariable(this->state_, VariableDirection::ToServer);
}
void MultiStateEngine::tick(float dt)
@@ -90,7 +90,7 @@
{
if (this->getShip()->hasLocalController())
{
- this->setObjectMode(objectDirection::bidirectional);
+ this->setObjectMode(ObjectDirection::Bidirectional);
const Vector3& direction = this->getDirection();
const Vector3& velocity = this->getShip()->getLocalVelocity();
Modified: branches/core4/src/orxonox/objects/pickup/ModifierPickup.cc
===================================================================
--- branches/core4/src/orxonox/objects/pickup/ModifierPickup.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/pickup/ModifierPickup.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -86,7 +86,7 @@
{
if (this->addTo(pawn))
{
- std::map<ModifierType::Enum, float>::iterator it;
+ std::map<ModifierType::Value, float>::iterator it;
for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
{
@@ -123,7 +123,7 @@
{
if (this->removeFrom(pawn))
{
- std::map<ModifierType::Enum, float>::iterator it;
+ std::map<ModifierType::Value, float>::iterator it;
for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
{
@@ -157,9 +157,9 @@
@param type ModifierType for which to return the modifier.
@return Returns the additive modifier for type (or 0 if not exists).
*/
- float ModifierPickup::getAdditiveModifier(ModifierType::Enum type) const
+ float ModifierPickup::getAdditiveModifier(ModifierType::Value type) const
{
- std::map<ModifierType::Enum, float>::const_iterator it = this->additiveModifiers_.find(type);
+ std::map<ModifierType::Value, float>::const_iterator it = this->additiveModifiers_.find(type);
if (it != this->additiveModifiers_.end())
return (*it).second;
else
@@ -170,9 +170,9 @@
@param type ModifierType for which to return the modifier.
@return Returns the multiplicative modifier for type (or 1 if not exists).
*/
- float ModifierPickup::getMultiplicativeModifier(ModifierType::Enum type) const
+ float ModifierPickup::getMultiplicativeModifier(ModifierType::Value type) const
{
- std::map<ModifierType::Enum, float>::const_iterator it = this->multiplicativeModifiers_.find(type);
+ std::map<ModifierType::Value, float>::const_iterator it = this->multiplicativeModifiers_.find(type);
if (it != this->multiplicativeModifiers_.end())
return (*it).second;
else
@@ -183,10 +183,10 @@
@param type ModifierType for which to return the modifier.
@param value The new additive modifier for type.
*/
- void ModifierPickup::setAdditiveModifier(ModifierType::Enum type, float value)
+ void ModifierPickup::setAdditiveModifier(ModifierType::Value type, float value)
{
if (this->additiveModifiers_.find(type) == this->additiveModifiers_.end())
- this->additiveModifiers_.insert( std::pair<ModifierType::Enum, float>(type, value) );
+ this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
else
this->additiveModifiers_[type] = value;
}
@@ -195,10 +195,10 @@
@param type ModifierType for which to return the modifier.
@param value The new multiplicative modifier for type.
*/
- void ModifierPickup::setMultiplicativeModifier(ModifierType::Enum type, float value)
+ void ModifierPickup::setMultiplicativeModifier(ModifierType::Value type, float value)
{
if (this->multiplicativeModifiers_.find(type) == this->multiplicativeModifiers_.end())
- this->multiplicativeModifiers_.insert( std::pair<ModifierType::Enum, float>(type, value) );
+ this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
else
this->multiplicativeModifiers_[type] = value;
}
Modified: branches/core4/src/orxonox/objects/pickup/ModifierPickup.h
===================================================================
--- branches/core4/src/orxonox/objects/pickup/ModifierPickup.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/pickup/ModifierPickup.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -129,13 +129,13 @@
void timerCallback(Pawn* pawn); //!< Method called when the timer runs out.
private:
- float getAdditiveModifier(ModifierType::Enum type) const; //!< Get the additive modifier for a given ModifierType.
- float getMultiplicativeModifier(ModifierType::Enum type) const; //!< Get the multiplicative modifier for a given ModifierType.
- void setAdditiveModifier(ModifierType::Enum type, float value); //!< Set the additive modifier for a given ModifierType.
- void setMultiplicativeModifier(ModifierType::Enum type, float value); //!< Set the multiplicative modifier for a given ModifierType
+ float getAdditiveModifier(ModifierType::Value type) const; //!< Get the additive modifier for a given ModifierType.
+ float getMultiplicativeModifier(ModifierType::Value type) const; //!< Get the multiplicative modifier for a given ModifierType.
+ void setAdditiveModifier(ModifierType::Value type, float value); //!< Set the additive modifier for a given ModifierType.
+ void setMultiplicativeModifier(ModifierType::Value type, float value); //!< Set the multiplicative modifier for a given ModifierType
- std::map<ModifierType::Enum, float> additiveModifiers_; //!< Map of additive modifiers, indexed by ModifierType.
- std::map<ModifierType::Enum, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType.
+ std::map<ModifierType::Value, float> additiveModifiers_; //!< Map of additive modifiers, indexed by ModifierType.
+ std::map<ModifierType::Value, float> multiplicativeModifiers_; //!< Map of multiplicative modifiers, indexed by ModifierType.
float duration_; //!< Duration of this pickup's effect (0 for unlimited).
Timer<ModifierPickup> timer_; //!< Timer used if the pickup's effect has a time limit.
Modified: branches/core4/src/orxonox/objects/pickup/ModifierType.h
===================================================================
--- branches/core4/src/orxonox/objects/pickup/ModifierType.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/pickup/ModifierType.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -43,7 +43,7 @@
/**
@brief Gives the available types for modifiers.
*/
- enum Enum
+ enum Value
{
Unknown = 0,
Damage,
Modified: branches/core4/src/orxonox/objects/pickup/PickupCollection.cc
===================================================================
--- branches/core4/src/orxonox/objects/pickup/PickupCollection.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/pickup/PickupCollection.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -41,7 +41,7 @@
namespace orxonox
{
typedef std::pair<std::multimap<std::string, BaseItem*>::iterator, std::multimap<std::string, BaseItem*>::iterator> item_range;
- typedef std::pair<std::multimap<ModifierType::Enum, float>::iterator, std::multimap<ModifierType::Enum, float>::iterator> modifier_range;
+ typedef std::pair<std::multimap<ModifierType::Value, float>::iterator, std::multimap<ModifierType::Value, float>::iterator> modifier_range;
//! Constructor
PickupCollection::PickupCollection()
@@ -199,22 +199,22 @@
@param type ModifierType to add.
@param value Value for the modifier.
*/
- void PickupCollection::addAdditiveModifier(ModifierType::Enum type, float value)
+ void PickupCollection::addAdditiveModifier(ModifierType::Value type, float value)
{
- this->additiveModifiers_.insert( std::pair<ModifierType::Enum, float>(type, value) );
+ this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
}
/**
@brief Get the total amount of an additive modifier.
@param type Type for which to get the total.
@return Returns the sum of the additive modifiers of the type.
*/
- float PickupCollection::getAdditiveModifier(ModifierType::Enum type)
+ float PickupCollection::getAdditiveModifier(ModifierType::Value type)
{
float v = 0.0f;
modifier_range range = this->additiveModifiers_.equal_range(type);
- for (std::multimap<ModifierType::Enum, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
+ for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
{
v += (*it).second;
}
@@ -226,10 +226,10 @@
@param type Type of modifier.
@param value Value which is to be removed.
*/
- void PickupCollection::removeAdditiveModifier(ModifierType::Enum type, float value)
+ void PickupCollection::removeAdditiveModifier(ModifierType::Value type, float value)
{
modifier_range range = this->additiveModifiers_.equal_range(type);
- for (std::multimap<ModifierType::Enum, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
+ for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
{
if ((*it).second == value)
{
@@ -243,21 +243,21 @@
@param type ModifierType to add.
@param value Value for the modifier.
*/
- void PickupCollection::addMultiplicativeModifier(ModifierType::Enum type, float value)
+ void PickupCollection::addMultiplicativeModifier(ModifierType::Value type, float value)
{
- this->multiplicativeModifiers_.insert( std::pair<ModifierType::Enum, float>(type, value) );
+ this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
}
/**
@brief Get the total amount of a multiplicative modifier.
@param type Type for which to get the total.
@return Returns the product of the multiplicative modifiers of the type.
*/
- float PickupCollection::getMultiplicativeModifier(ModifierType::Enum type)
+ float PickupCollection::getMultiplicativeModifier(ModifierType::Value type)
{
float v = 1.0f;
modifier_range range = this->multiplicativeModifiers_.equal_range(type);
- for (std::multimap<ModifierType::Enum, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
+ for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
{
v *= (*it).second;
}
@@ -269,10 +269,10 @@
@param type Type of modifier.
@param value Value which is to be removed.
*/
- void PickupCollection::removeMultiplicativeModifier(ModifierType::Enum type, float value)
+ void PickupCollection::removeMultiplicativeModifier(ModifierType::Value type, float value)
{
modifier_range range = this->multiplicativeModifiers_.equal_range(type);
- for (std::multimap<ModifierType::Enum, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
+ for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
{
if ((*it).second == value)
{
@@ -288,7 +288,7 @@
@param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
@return Returns the value after being processed.
*/
- float PickupCollection::processModifiers(ModifierType::Enum type, float inputValue, bool addBeforeMultiplication)
+ float PickupCollection::processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication)
{
float outputValue = inputValue;
@@ -309,7 +309,7 @@
@param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
@return Returns the value after being processed.
*/
- Vector3 PickupCollection::processModifiers(ModifierType::Enum type, Vector3 inputValue, bool addBeforeMultiplication)
+ Vector3 PickupCollection::processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication)
{
Vector3 outputValue = inputValue;
Modified: branches/core4/src/orxonox/objects/pickup/PickupCollection.h
===================================================================
--- branches/core4/src/orxonox/objects/pickup/PickupCollection.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/pickup/PickupCollection.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -66,17 +66,17 @@
void useItem(); //!< Use the first usable item.
void useItem(UsableItem* item); //!< Use a usable item.
- void addAdditiveModifier(ModifierType::Enum type, float value); //!< Add an additive modifier.
- void addMultiplicativeModifier(ModifierType::Enum type, float value); //!< Add a multiplicative modifier.
+ void addAdditiveModifier(ModifierType::Value type, float value); //!< Add an additive modifier.
+ void addMultiplicativeModifier(ModifierType::Value type, float value); //!< Add a multiplicative modifier.
- float getAdditiveModifier(ModifierType::Enum type); //!< Get total additive modifier.
- float getMultiplicativeModifier(ModifierType::Enum type); //!< Get total multiplicative modifier.
+ float getAdditiveModifier(ModifierType::Value type); //!< Get total additive modifier.
+ float getMultiplicativeModifier(ModifierType::Value type); //!< Get total multiplicative modifier.
- void removeAdditiveModifier(ModifierType::Enum type, float value); //!< Remove an additive modifier.
- void removeMultiplicativeModifier(ModifierType::Enum type, float value); //!< Remove a multiplicative modifier.
+ void removeAdditiveModifier(ModifierType::Value type, float value); //!< Remove an additive modifier.
+ void removeMultiplicativeModifier(ModifierType::Value type, float value); //!< Remove a multiplicative modifier.
- float processModifiers(ModifierType::Enum type, float inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a float.
- Vector3 processModifiers(ModifierType::Enum type, Vector3 inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a Vector3.
+ float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a float.
+ Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false); //!< Apply the modifiers to a Vector3.
/**
@brief Get the map of contained items.
@@ -112,8 +112,8 @@
bool bBlockRemovals_; //!< Whether to block direct removals through remove().
- std::multimap<ModifierType::Enum, float> additiveModifiers_; //!< Contains additive modifiers (indexed by ModifierType).
- std::multimap<ModifierType::Enum, float> multiplicativeModifiers_; //!< Contains multiplicative modifiers (indexed by ModifierType).
+ std::multimap<ModifierType::Value, float> additiveModifiers_; //!< Contains additive modifiers (indexed by ModifierType).
+ std::multimap<ModifierType::Value, float> multiplicativeModifiers_; //!< Contains multiplicative modifiers (indexed by ModifierType).
std::multimap<std::string, BaseItem*> items_; //!< Map of items in the collection (indexed by pickupIdentifier of the items).
};
Modified: branches/core4/src/orxonox/objects/quest/GlobalQuest.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/GlobalQuest.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/GlobalQuest.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -146,7 +146,7 @@
{
return false;
}
- return (this->isInactive(player) && !(this->status_ == questStatus::completed || this->status_ == questStatus::failed));
+ return (this->isInactive(player) && !(this->status_ == QuestStatus::Completed || this->status_ == QuestStatus::Failed));
}
/**
@@ -188,7 +188,7 @@
@throws
Throws an Exception if player is NULL.
*/
- questStatus::Enum GlobalQuest::getStatus(const PlayerInfo* player) const
+ QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
{
if(player == NULL) //!< We don't want NULL-Pointers!
{
@@ -202,7 +202,7 @@
return this->status_;
}
- return questStatus::inactive;
+ return QuestStatus::Inactive;
}
/**
@@ -216,7 +216,7 @@
@return
Returns false if player is NULL.
*/
- bool GlobalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
+ bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
{
if(player == NULL) //!< We don't want NULL-Pointers!
{
Modified: branches/core4/src/orxonox/objects/quest/GlobalQuest.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/GlobalQuest.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/GlobalQuest.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -96,13 +96,13 @@
virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
- virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
+ virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
- virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
+ virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
private:
std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest.
- questStatus::Enum status_; //!< The status of this Quest.
+ QuestStatus::Value status_; //!< The status of this Quest.
std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects.
Modified: branches/core4/src/orxonox/objects/quest/LocalQuest.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/LocalQuest.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/LocalQuest.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -175,20 +175,20 @@
@throws
Throws an Exception if player is NULL.
*/
- questStatus::Enum LocalQuest::getStatus(const PlayerInfo* player) const
+ QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const
{
if(player == NULL) //!< No player has no defined status.
{
ThrowException(Argument, "The input PlayerInfo* is NULL.");
}
- std::map<const PlayerInfo*, questStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
+ std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player);
if (it != this->playerStatus_.end()) //!< If there is a player in the map.
{
return it->second;
}
- return questStatus::inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
+ return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'.
}
/**
@@ -202,7 +202,7 @@
@return
Returns false if player is NULL.
*/
- bool LocalQuest::setStatus(PlayerInfo* player, const questStatus::Enum & status)
+ bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
{
if(player == NULL) //!< We can't set a status for no player.
{
Modified: branches/core4/src/orxonox/objects/quest/LocalQuest.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/LocalQuest.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/LocalQuest.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -90,11 +90,11 @@
virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed.
virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed.
- virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
- virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
+ virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
+ virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
private:
- std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
+ std::map<const PlayerInfo*, QuestStatus::Value> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
};
Modified: branches/core4/src/orxonox/objects/quest/Quest.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/Quest.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/Quest.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -301,7 +301,7 @@
*/
bool Quest::isInactive(const PlayerInfo* player) const
{
- return this->getStatus(player) == questStatus::inactive;
+ return this->getStatus(player) == QuestStatus::Inactive;
}
/**
@@ -317,7 +317,7 @@
bool Quest::isActive(const PlayerInfo* player) const
{
- return this->getStatus(player) == questStatus::active;
+ return this->getStatus(player) == QuestStatus::Active;
}
/**
@@ -332,7 +332,7 @@
*/
bool Quest::isFailed(const PlayerInfo* player) const
{
- return this->getStatus(player) == questStatus::failed;
+ return this->getStatus(player) == QuestStatus::Failed;
}
/**
@@ -347,7 +347,7 @@
*/
bool Quest::isCompleted(const PlayerInfo* player) const
{
- return this->getStatus(player) == questStatus::completed;
+ return this->getStatus(player) == QuestStatus::Completed;
}
/**
@@ -361,7 +361,7 @@
bool Quest::fail(PlayerInfo* player)
{
QuestListener::advertiseStatusChange(this->listeners_, "fail"); //!< Tells the QuestListeners, that the status has changed to failed.
- this->setStatus(player, questStatus::failed);
+ this->setStatus(player, QuestStatus::Failed);
COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl;
@@ -380,7 +380,7 @@
bool Quest::complete(PlayerInfo* player)
{
QuestListener::advertiseStatusChange(this->listeners_, "complete"); //!< Tells the QuestListeners, that the status has changed to completed.
- this->setStatus(player, questStatus::completed);
+ this->setStatus(player, QuestStatus::Completed);
COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl;
@@ -408,7 +408,7 @@
QuestListener::advertiseStatusChange(this->listeners_, "start"); //!< Tells the QuestListeners, that the status has changed to active.
- this->setStatus(player, questStatus::active);
+ this->setStatus(player, QuestStatus::Active);
this->getDescription()->sendAddQuestNotification();
return true;
Modified: branches/core4/src/orxonox/objects/quest/Quest.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/Quest.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/Quest.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -42,18 +42,16 @@
namespace orxonox
{
- namespace questStatus
+ namespace QuestStatus
{
-
//!Different states of a Quest.
- enum Enum
+ enum Value
{
- inactive,
- active,
- failed,
- completed
+ Inactive,
+ Active,
+ Failed,
+ Completed
};
-
}
/**
@@ -132,8 +130,8 @@
inline std::list<QuestEffect*> & getCompleteEffectList(void)
{ return this->completeEffects_; }
- virtual questStatus::Enum getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
- virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
+ virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
+ virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
private:
Quest* parentQuest_; //!< Pointer to the parentquest.
Modified: branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -52,7 +52,7 @@
{
RegisterObject(QuestEffectBeacon);
- this->status_ = QuestEffectBeaconStatus::active;
+ this->status_ = QuestEffectBeaconStatus::Active;
this->times_ = INFINITE_TIME;
}
@@ -161,11 +161,11 @@
if(activate)
{
- this->status_ = QuestEffectBeaconStatus::active;
+ this->status_ = QuestEffectBeaconStatus::Active;
return true;
}
- this->status_ = QuestEffectBeaconStatus::inactive;
+ this->status_ = QuestEffectBeaconStatus::Inactive;
return true;
}
@@ -189,7 +189,7 @@
this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed.
if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
{
- this->status_ = QuestEffectBeaconStatus::inactive;
+ this->status_ = QuestEffectBeaconStatus::Inactive;
}
return true;
Modified: branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestEffectBeacon.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -43,14 +43,12 @@
{
namespace QuestEffectBeaconStatus
{
-
//! The status of the beacon, can be either active or inactive.
- enum Enum
+ enum Value
{
- inactive,
- active
+ Inactive,
+ Active
};
-
}
/**
@@ -97,7 +95,7 @@
@return Returns true if the QuestEffectBeacon is active, fals if not.
*/
inline bool isActive(void)
- { return this->status_ == QuestEffectBeaconStatus::active; }
+ { return this->status_ == QuestEffectBeaconStatus::Active; }
bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
@@ -116,7 +114,7 @@
std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
int times_; //!< Number of times the beacon can be exectued.
- QuestEffectBeaconStatus::Enum status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
+ QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon.
Modified: branches/core4/src/orxonox/objects/quest/QuestHint.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestHint.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestHint.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -94,13 +94,13 @@
}
//! Find the player.
- std::map<const PlayerInfo*, questHintStatus::Enum>::const_iterator it = this->playerStatus_.find(player);
+ std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player);
if (it != this->playerStatus_.end()) //!< If the player is in the map.
{
return it->second;
}
- return questStatus::inactive;
+ return QuestStatus::Inactive;
}
/**
@@ -117,7 +117,7 @@
{
if(!(this->isActive(player))) //!< If the hint is already active, activation is pointless.
{
- this->playerStatus_[player] = questHintStatus::active;
+ this->playerStatus_[player] = QuestHintStatus::Active;
this->getDescription()->sendAddHintNotification();
return true;
Modified: branches/core4/src/orxonox/objects/quest/QuestHint.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestHint.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestHint.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -41,16 +41,14 @@
namespace orxonox
{
- namespace questHintStatus
+ namespace QuestHintStatus
{
-
//! The state of the hint.
- enum Enum
+ enum Value
{
- inactive,
- active
+ Inactive,
+ Active
};
-
}
/**
@@ -90,7 +88,7 @@
private:
Quest* quest_; //!< The Quest the QuestHint belongs to.
- std::map<const PlayerInfo*, questHintStatus::Enum> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
+ std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
};
Modified: branches/core4/src/orxonox/objects/quest/QuestListener.cc
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestListener.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestListener.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -50,7 +50,7 @@
{
RegisterObject(QuestListener);
- this->mode_ = questListenerMode::all;
+ this->mode_ = QuestListenerMode::All;
this->quest_ = NULL;
}
@@ -131,24 +131,24 @@
{
if(mode == "all")
{
- this->mode_ = questListenerMode::all;
+ this->mode_ = QuestListenerMode::All;
}
else if(mode == "start")
{
- this->mode_ = questListenerMode::start;
+ this->mode_ = QuestListenerMode::Start;
}
else if(mode == "fail")
{
- this->mode_ = questListenerMode::fail;
+ this->mode_ = QuestListenerMode::Fail;
}
else if(mode == "complete")
{
- this->mode_ = questListenerMode::complete;
+ this->mode_ = QuestListenerMode::Complete;
}
else
{
COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl;
- this->mode_ = questListenerMode::all;
+ this->mode_ = QuestListenerMode::All;
return false;
}
@@ -163,19 +163,19 @@
*/
std::string QuestListener::getMode(void)
{
- if(this->mode_ == questListenerMode::all)
+ if(this->mode_ == QuestListenerMode::All)
{
return "all";
}
- else if(this->mode_ == questListenerMode::start)
+ else if(this->mode_ == QuestListenerMode::Start)
{
return "start";
}
- else if(this->mode_ == questListenerMode::fail)
+ else if(this->mode_ == QuestListenerMode::Fail)
{
return "fail";
}
- else if(this->mode_ == questListenerMode::complete)
+ else if(this->mode_ == QuestListenerMode::Complete)
{
return "complete";
}
Modified: branches/core4/src/orxonox/objects/quest/QuestListener.h
===================================================================
--- branches/core4/src/orxonox/objects/quest/QuestListener.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/quest/QuestListener.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -42,18 +42,16 @@
namespace orxonox
{
- namespace questListenerMode
+ namespace QuestListenerMode
{
-
//! The mode of the QuestListener.
- enum Enum
+ enum Value
{
- all,
- start,
- fail,
- complete
+ All,
+ Start,
+ Fail,
+ Complete
};
-
}
/**
@@ -92,7 +90,7 @@
bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
private:
- questListenerMode::Enum mode_; //!< The mode of the QuestListener.
+ QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
};
Modified: branches/core4/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc
===================================================================
--- branches/core4/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -43,7 +43,7 @@
if (GameMode::showsGraphics())
{
- this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
+ this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::Normal);
this->attachOgreObject(this->particles_->getParticleSystem());
this->particles_->setKeepParticlesInLocalSpace(0);
Modified: branches/core4/src/orxonox/objects/worldentities/Backlight.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Backlight.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Backlight.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -107,11 +107,11 @@
void Backlight::registerVariables()
{
- registerVariable(this->width_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_width));
- registerVariable(this->lifetime_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime));
- registerVariable(this->length_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_length));
- registerVariable(this->maxelements_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements));
- registerVariable(this->trailmaterial_, variableDirection::toclient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial));
+ registerVariable(this->width_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_width));
+ registerVariable(this->lifetime_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_lifetime));
+ registerVariable(this->length_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_length));
+ registerVariable(this->maxelements_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_maxelements));
+ registerVariable(this->trailmaterial_, VariableDirection::ToClient, new NetworkCallback<Backlight>(this, &Backlight::update_trailmaterial));
}
void Backlight::changedColour()
Modified: branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/BigExplosion.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -55,7 +55,7 @@
this->firstTick_ = true;
*/
this->bStop_ = false;
- this->LOD_ = LODParticle::normal;
+ this->LOD_ = LODParticle::Normal;
/* this->stf_ = "setTimeFactor ";
this->timeFactor_ = 1;
@@ -306,8 +306,8 @@
void BigExplosion::registerVariables()
{
- registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
- registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
+ registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::LODchanged));
+ registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<BigExplosion>(this, &BigExplosion::checkStop));
}
void BigExplosion::LODchanged()
Modified: branches/core4/src/orxonox/objects/worldentities/BigExplosion.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/BigExplosion.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/BigExplosion.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -46,9 +46,9 @@
virtual void tick(float dt);
void registerVariables();
- inline void setLOD(LODParticle::LOD level)
+ inline void setLOD(LODParticle::Value level)
{ this->LOD_ = level; this->LODchanged(); }
- inline LODParticle::LOD getLOD() const
+ inline LODParticle::Value getLOD() const
{ return this->LOD_; }
private:
@@ -97,7 +97,7 @@
ParticleInterface* explosionSmoke_;
ParticleInterface* explosionFire_;
- LODParticle::LOD LOD_;
+ LODParticle::Value LOD_;
Timer<BigExplosion> destroyTimer_;
};
}
Modified: branches/core4/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Billboard.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Billboard.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -68,9 +68,9 @@
void Billboard::registerVariables()
{
- registerVariable(this->material_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
- registerVariable(this->colour_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
-// registerVariable(this->rotation_, variableDirection::toclient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
+ registerVariable(this->material_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedMaterial));
+ registerVariable(this->colour_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedColour));
+// registerVariable(this->rotation_, VariableDirection::ToClient, new NetworkCallback<Billboard>(this, &Billboard::changedRotation));
}
void Billboard::changedMaterial()
Modified: branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/BlinkingBillboard.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -65,9 +65,9 @@
void BlinkingBillboard::registerVariables()
{
-// registerVariable(this->amplitude_, variableDirection::toclient);
-// registerVariable(this->frequency_, variableDirection::toclient);
-// registerVariable(this->phase_, variableDirection::toclient);
+// registerVariable(this->amplitude_, VariableDirection::ToClient);
+// registerVariable(this->frequency_, VariableDirection::ToClient);
+// registerVariable(this->phase_, VariableDirection::ToClient);
}
void BlinkingBillboard::tick(float dt)
Modified: branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/ControllableEntity.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -78,7 +78,7 @@
this->setConfigValues();
- this->setPriority( priority::very_high );
+ this->setPriority( Priority::VeryHigh );
this->registerVariables();
}
@@ -237,7 +237,7 @@
if (!GameMode::isMaster())
{
this->client_overwrite_ = this->server_overwrite_;
- this->setObjectMode(objectDirection::bidirectional);
+ this->setObjectMode(ObjectDirection::Bidirectional);
}
}
@@ -253,7 +253,7 @@
this->playerID_ = OBJECTID_UNKNOWN;
this->bHasLocalController_ = false;
this->bHasHumanController_ = false;
- this->setObjectMode(objectDirection::toclient);
+ this->setObjectMode(ObjectDirection::ToClient);
this->changedPlayer();
@@ -367,24 +367,24 @@
void ControllableEntity::registerVariables()
{
- registerVariable(this->cameraPositionTemplate_, variableDirection::toclient);
- registerVariable(this->hudtemplate_, variableDirection::toclient);
+ registerVariable(this->cameraPositionTemplate_, VariableDirection::ToClient);
+ registerVariable(this->hudtemplate_, VariableDirection::ToClient);
- registerVariable(this->server_position_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
- registerVariable(this->server_linear_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));
- registerVariable(this->server_orientation_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
- registerVariable(this->server_angular_velocity_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));
+ registerVariable(this->server_position_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
+ registerVariable(this->server_linear_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerLinearVelocity));
+ registerVariable(this->server_orientation_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
+ registerVariable(this->server_angular_velocity_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerAngularVelocity));
- registerVariable(this->server_overwrite_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
- registerVariable(this->client_overwrite_, variableDirection::toserver);
+ registerVariable(this->server_overwrite_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
+ registerVariable(this->client_overwrite_, VariableDirection::ToServer);
- registerVariable(this->client_position_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
- registerVariable(this->client_linear_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));
- registerVariable(this->client_orientation_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
- registerVariable(this->client_angular_velocity_, variableDirection::toserver, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));
+ registerVariable(this->client_position_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
+ registerVariable(this->client_linear_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientLinearVelocity));
+ registerVariable(this->client_orientation_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
+ registerVariable(this->client_angular_velocity_, VariableDirection::ToServer, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientAngularVelocity));
- registerVariable(this->playerID_, variableDirection::toclient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
+ registerVariable(this->playerID_, VariableDirection::ToClient, new NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
}
void ControllableEntity::processServerPosition()
Modified: branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -47,7 +47,7 @@
ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
this->bStop_ = false;
- this->LOD_ = LODParticle::normal;
+ this->LOD_ = LODParticle::Normal;
if ( GameMode::showsGraphics() )
{
@@ -103,8 +103,8 @@
void ExplosionChunk::registerVariables()
{
- registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged));
- registerVariable(this->bStop_, variableDirection::toclient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop));
+ registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::LODchanged));
+ registerVariable(this->bStop_, VariableDirection::ToClient, new NetworkCallback<ExplosionChunk>(this, &ExplosionChunk::checkStop));
}
void ExplosionChunk::LODchanged()
Modified: branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/ExplosionChunk.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -45,9 +45,9 @@
virtual void tick(float dt);
void registerVariables();
- inline void setLOD(LODParticle::LOD level)
+ inline void setLOD(LODParticle::Value level)
{ this->LOD_ = level; this->LODchanged(); }
- inline LODParticle::LOD getLOD() const
+ inline LODParticle::Value getLOD() const
{ return this->LOD_; }
private:
@@ -59,7 +59,7 @@
bool bStop_;
ParticleInterface* fire_;
ParticleInterface* smoke_;
- LODParticle::LOD LOD_;
+ LODParticle::Value LOD_;
Timer<ExplosionChunk> destroyTimer_;
};
}
Modified: branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/FadingBillboard.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -63,8 +63,8 @@
void FadingBillboard::registerVariables()
{
- registerVariable(this->turnontime_, variableDirection::toclient);
- registerVariable(this->turnofftime_, variableDirection::toclient);
+ registerVariable(this->turnontime_, VariableDirection::ToClient);
+ registerVariable(this->turnofftime_, VariableDirection::ToClient);
}
void FadingBillboard::changedColour()
Modified: branches/core4/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Light.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Light.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -44,9 +44,9 @@
CreateFactory(Light);
// Be sure we don't do bad conversions
- BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light::LT_POINT);
- BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::LT_DIRECTIONAL);
- BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::LT_SPOTLIGHT);
+ BOOST_STATIC_ASSERT((int)Ogre::Light::LT_POINT == (int)Light::Point);
+ BOOST_STATIC_ASSERT((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional);
+ BOOST_STATIC_ASSERT((int)Ogre::Light::LT_SPOTLIGHT == (int)Light::Spotlight);
Light::Light(BaseObject* creator) : StaticEntity(creator)
{
@@ -55,7 +55,7 @@
this->light_ = 0;
this->diffuse_ = ColourValue::White;
this->specular_ = ColourValue::White;
- this->type_ = Light::LT_POINT;
+ this->type_ = Light::Point;
this->attenuation_ = Vector4(100000, 1, 0, 0);
this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
@@ -105,11 +105,11 @@
void Light::registerVariables()
{
- registerVariable((int&)this->type_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateType));
- registerVariable(this->diffuse_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
- registerVariable(this->specular_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
- registerVariable(this->attenuation_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateAttenuation));
- registerVariable(this->spotlightRange_, variableDirection::toclient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));
+ registerVariable((int&)this->type_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));
+ registerVariable(this->diffuse_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
+ registerVariable(this->specular_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
+ registerVariable(this->attenuation_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateAttenuation));
+ registerVariable(this->spotlightRange_, VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpotlightRange));
}
void Light::updateDiffuseColour()
@@ -126,37 +126,37 @@
void Light::updateAttenuation()
{
- if (this->light_ && this->type_ != Light::LT_DIRECTIONAL)
+ if (this->light_ && this->type_ != Light::Directional)
this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w);
}
void Light::updateSpotlightRange()
{
- if (this->light_ && this->type_ == Light::LT_SPOTLIGHT)
+ if (this->light_ && this->type_ == Light::Spotlight)
this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z);
}
void Light::setTypeString(const std::string& type)
{
if (type == "point")
- this->setType(Light::LT_POINT);
+ this->setType(Light::Point);
else if (type == "directional")
- this->setType(Light::LT_DIRECTIONAL);
+ this->setType(Light::Directional);
else if (type == "spotlight")
- this->setType(Light::LT_SPOTLIGHT);
+ this->setType(Light::Spotlight);
else
- this->setType(Light::LT_POINT);
+ this->setType(Light::Point);
}
std::string Light::getTypeString() const
{
switch (this->type_)
{
- case Light::LT_DIRECTIONAL:
+ case Light::Directional:
return "directional";
- case Light::LT_SPOTLIGHT:
+ case Light::Spotlight:
return "spotlight";
- case Light::LT_POINT:
+ case Light::Point:
default:
return "point";
}
@@ -168,9 +168,9 @@
{
this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_));
- if (this->type_ != Light::LT_DIRECTIONAL)
+ if (this->type_ != Light::Directional)
this->updateAttenuation();
- if (this->type_ == Light::LT_SPOTLIGHT)
+ if (this->type_ == Light::Spotlight)
this->updateSpotlightRange();
}
}
Modified: branches/core4/src/orxonox/objects/worldentities/Light.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Light.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Light.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -44,11 +44,11 @@
enum LightTypes // Copy from the Ogre enum
{
/// Point light sources give off light equally in all directions, so require only position not direction
- LT_POINT,
+ Point,
/// Directional lights simulate parallel light beams from a distant source, hence have direction but no position
- LT_DIRECTIONAL,
+ Directional,
/// Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff
- LT_SPOTLIGHT
+ Spotlight
};
public:
Modified: branches/core4/src/orxonox/objects/worldentities/Model.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Model.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Model.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -64,8 +64,8 @@
void Model::registerVariables()
{
- registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedMesh));
- registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Model>(this, &Model::changedShadows));
+ registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedMesh));
+ registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Model>(this, &Model::changedShadows));
}
void Model::changedMesh()
Modified: branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/MovableEntity.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -51,7 +51,7 @@
this->continuousResynchroTimer_ = 0;
- this->setPriority(priority::low);
+ this->setPriority(Priority::Low);
this->registerVariables();
}
@@ -88,11 +88,11 @@
void MovableEntity::registerVariables()
{
- registerVariable(this->linearVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));
- registerVariable(this->angularVelocity_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity));
+ registerVariable(this->linearVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processLinearVelocity));
+ registerVariable(this->angularVelocity_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::processAngularVelocity));
- registerVariable(this->overwrite_position_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
- registerVariable(this->overwrite_orientation_, variableDirection::toclient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
+ registerVariable(this->overwrite_position_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwritePosition));
+ registerVariable(this->overwrite_orientation_, VariableDirection::ToClient, new NetworkCallback<MovableEntity>(this, &MovableEntity::overwriteOrientation));
}
void MovableEntity::clientConnected(unsigned int clientID)
Modified: branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -52,7 +52,7 @@
ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given.");
this->particles_ = 0;
- this->LOD_ = LODParticle::normal;
+ this->LOD_ = LODParticle::Normal;
this->registerVariables();
}
@@ -70,14 +70,14 @@
{
SUPER(ParticleEmitter, XMLPort, xmlelement, mode);
- XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle::normal);
+ XMLPortParam(ParticleEmitter, "lod", setLODxml, getLODxml, xmlelement, mode).defaultValues(LODParticle::Normal);
XMLPortParam(ParticleEmitter, "source", setSource, getSource, xmlelement, mode);
}
void ParticleEmitter::registerVariables()
{
- registerVariable(this->source_, variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
- registerVariable((int&)(this->LOD_), variableDirection::toclient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
+ registerVariable(this->source_, VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::sourceChanged));
+ registerVariable((int&)(this->LOD_), VariableDirection::ToClient, new NetworkCallback<ParticleEmitter>(this, &ParticleEmitter::LODchanged));
}
void ParticleEmitter::changedVisibility()
Modified: branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/ParticleEmitter.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -56,14 +56,14 @@
inline const std::string& getSource() const
{ return this->source_; }
- inline void setLOD(LODParticle::LOD level)
+ inline void setLOD(LODParticle::Value level)
{ this->LOD_ = level; this->LODchanged(); }
- inline LODParticle::LOD getLOD() const
+ inline LODParticle::Value getLOD() const
{ return this->LOD_; }
protected:
inline void setLODxml(unsigned int level)
- { this->LOD_ = (LODParticle::LOD)level; this->LODchanged(); }
+ { this->LOD_ = (LODParticle::Value)level; this->LODchanged(); }
inline unsigned int getLODxml() const
{ return (unsigned int)this->LOD_; }
@@ -72,7 +72,7 @@
ParticleInterface* particles_;
std::string source_;
- LODParticle::LOD LOD_;
+ LODParticle::Value LOD_;
};
}
Modified: branches/core4/src/orxonox/objects/worldentities/Planet.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/Planet.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/Planet.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -156,11 +156,11 @@
void Planet::registerVariables()
{
- registerVariable(this->atmosphere_, variableDirection::toclient);
- registerVariable(this->meshSrc_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
- registerVariable(this->bCastShadows_, variableDirection::toclient, new NetworkCallback<Planet>(this, &Planet::changedShadows));
- registerVariable(this->atmosphereSize, variableDirection::toclient);
- registerVariable(this->imageSize, variableDirection::toclient);
+ registerVariable(this->atmosphere_, VariableDirection::ToClient);
+ registerVariable(this->meshSrc_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedMesh));
+ registerVariable(this->bCastShadows_, VariableDirection::ToClient, new NetworkCallback<Planet>(this, &Planet::changedShadows));
+ registerVariable(this->atmosphereSize, VariableDirection::ToClient);
+ registerVariable(this->imageSize, VariableDirection::ToClient);
}
void Planet::changedVisibility()
Modified: branches/core4/src/orxonox/objects/worldentities/PongBall.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/PongBall.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/PongBall.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -71,7 +71,7 @@
registerVariable( this->speed_ );
registerVariable( this->relMercyOffset_ );
registerVariable( this->batID_[0] );
- registerVariable( this->batID_[1], variableDirection::toclient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) );
+ registerVariable( this->batID_[1], VariableDirection::ToClient, new NetworkCallback<PongBall>( this, &PongBall::applyBats) );
}
void PongBall::tick(float dt)
Modified: branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/StaticEntity.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -42,7 +42,7 @@
{
RegisterObject(StaticEntity);
- this->setPriority(priority::very_low);
+ this->setPriority(Priority::VeryLow);
this->registerVariables();
}
@@ -53,8 +53,8 @@
void StaticEntity::registerVariables()
{
- registerVariable(this->getPosition(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
- registerVariable(this->getOrientation(), variableDirection::toclient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
+ registerVariable(this->getPosition(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
+ registerVariable(this->getOrientation(), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
}
Modified: branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/WorldEntity.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -174,31 +174,31 @@
void WorldEntity::registerVariables()
{
- registerVariable(this->mainStateName_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));
+ registerVariable(this->mainStateName_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedMainState));
- registerVariable(this->bActive_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
- registerVariable(this->bVisible_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
+ registerVariable(this->bActive_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedActivity));
+ registerVariable(this->bVisible_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::changedVisibility));
- registerVariable(this->getScale3D(), variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
+ registerVariable(this->getScale3D(), VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::scaleChanged));
// Physics stuff
- registerVariable(this->mass_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));
- registerVariable(this->restitution_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));
- registerVariable(this->angularFactor_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));
- registerVariable(this->linearDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));
- registerVariable(this->angularDamping_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));
- registerVariable(this->friction_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));
+ registerVariable(this->mass_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::massChanged));
+ registerVariable(this->restitution_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::restitutionChanged));
+ registerVariable(this->angularFactor_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularFactorChanged));
+ registerVariable(this->linearDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::linearDampingChanged));
+ registerVariable(this->angularDamping_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::angularDampingChanged));
+ registerVariable(this->friction_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::frictionChanged));
registerVariable(this->bCollisionCallbackActive_,
- variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));
+ VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionCallbackActivityChanged));
registerVariable(this->bCollisionResponseActive_,
- variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));
+ VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));
registerVariable((int&)this->collisionTypeSynchronised_,
- variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
+ VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
registerVariable(this->bPhysicsActiveSynchronised_,
- variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));
+ VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::physicsActivityChanged));
// Attach to parent if necessary
- registerVariable(this->parentID_, variableDirection::toclient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
+ registerVariable(this->parentID_, VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::networkcallback_parentChanged));
}
/**
Modified: branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/pawns/Pawn.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -116,10 +116,10 @@
void Pawn::registerVariables()
{
- registerVariable(this->bAlive_, variableDirection::toclient);
- registerVariable(this->health_, variableDirection::toclient);
- registerVariable(this->initialHealth_, variableDirection::toclient);
- registerVariable(this->bReload_, variableDirection::toserver);
+ registerVariable(this->bAlive_, VariableDirection::ToClient);
+ registerVariable(this->health_, VariableDirection::ToClient);
+ registerVariable(this->initialHealth_, VariableDirection::ToClient);
+ registerVariable(this->bReload_, VariableDirection::ToServer);
}
void Pawn::tick(float dt)
Modified: branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/pawns/SpaceShip.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -89,9 +89,9 @@
void SpaceShip::registerVariables()
{
- registerVariable(this->primaryThrust_, variableDirection::toclient);
- registerVariable(this->auxilaryThrust_, variableDirection::toclient);
- registerVariable(this->rotationThrust_, variableDirection::toclient);
+ registerVariable(this->primaryThrust_, VariableDirection::ToClient);
+ registerVariable(this->auxilaryThrust_, VariableDirection::ToClient);
+ registerVariable(this->rotationThrust_, VariableDirection::ToClient);
}
void SpaceShip::setConfigValues()
Modified: branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/pawns/Spectator.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -92,8 +92,8 @@
void Spectator::registerVariables()
{
- registerVariable(this->bGreetingFlareVisible_, variableDirection::toclient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
- registerVariable(this->bGreeting_, variableDirection::toserver, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
+ registerVariable(this->bGreetingFlareVisible_, VariableDirection::ToClient, new NetworkCallback<Spectator>(this, &Spectator::changedFlareVisibility));
+ registerVariable(this->bGreeting_, VariableDirection::ToServer, new NetworkCallback<Spectator>(this, &Spectator::changedGreeting));
}
void Spectator::changedGreeting()
@@ -144,7 +144,7 @@
{
ControllableEntity::setPlayer(player);
-// this->setObjectMode(objectDirection::toclient);
+// this->setObjectMode(ObjectDirection::ToClient);
}
void Spectator::startLocalHumanControl()
Modified: branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -42,7 +42,7 @@
{
RegisterObject(TeamBaseMatchBase);
- this->state_ = BaseState::uncontrolled;
+ this->state_ = BaseState::Uncontrolled;
TeamBaseMatch* gametype = orxonox_cast<TeamBaseMatch*>(this->getGametype());
if (gametype)
@@ -65,13 +65,13 @@
switch (this->state_)
{
- case BaseState::controlTeam1:
+ case BaseState::ControlTeam1:
colour = gametype->getTeamColour(0);
break;
- case BaseState::controlTeam2:
+ case BaseState::ControlTeam2:
colour = gametype->getTeamColour(1);
break;
- case BaseState::uncontrolled:
+ case BaseState::Uncontrolled:
default:
colour = ColourValue(0.5, 0.5, 0.5, 1.0);
break;
Modified: branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/pawns/TeamBaseMatchBase.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -37,11 +37,11 @@
{
namespace BaseState
{
- enum Enum
+ enum Value
{
- uncontrolled,
- controlTeam1,
- controlTeam2,
+ Uncontrolled,
+ ControlTeam1,
+ ControlTeam2,
};
}
@@ -57,7 +57,7 @@
// Set the state of a base to whatever the argument of the function is
- void setState(BaseState::Enum state)
+ void setState(BaseState::Value state)
{
this->state_ = state;
this->changeTeamColour();
@@ -65,7 +65,7 @@
// Get the state of a base as a return value
- BaseState::Enum getState() const
+ BaseState::Value getState() const
{
return this->state_;
}
@@ -74,7 +74,7 @@
protected:
void changeTeamColour();
- BaseState::Enum state_;
+ BaseState::Value state_;
};
}
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -140,7 +140,7 @@
return false;
}
- bool DistanceTrigger::isTriggered(TriggerMode mode)
+ bool DistanceTrigger::isTriggered(TriggerMode::Value mode)
{
if (Trigger::isTriggered(mode))
{
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/DistanceTrigger.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -58,7 +58,7 @@
bool checkDistance();
protected:
- virtual bool isTriggered(TriggerMode mode);
+ virtual bool isTriggered(TriggerMode::Value mode);
virtual void notifyMaskUpdate() {}
ClassTreeMask targetMask_;
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -53,7 +53,7 @@
ORXONOX_SET_EVENT(EventTrigger, "trigger", trigger, event);
}
- bool EventTrigger::isTriggered(TriggerMode mode)
+ bool EventTrigger::isTriggered(TriggerMode::Value mode)
{
if (Trigger::isTriggered(mode))
return this->bEventTriggered_;
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/EventTrigger.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -46,7 +46,7 @@
{ this->bEventTriggered_ = bTriggered; this->tick(0); }
protected:
- virtual bool isTriggered(TriggerMode mode);
+ virtual bool isTriggered(TriggerMode::Value mode);
private:
bool bEventTriggered_;
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -69,7 +69,7 @@
{ return this->isForPlayer_; }
protected:
- virtual bool isTriggered(TriggerMode mode) = 0;
+ virtual bool isTriggered(TriggerMode::Value mode) = 0;
/**
@brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -45,7 +45,7 @@
{
RegisterObject(Trigger);
- this->mode_ = TM_EventTriggerAND;
+ this->mode_ = TriggerMode::EventTriggerAND;
this->bFirstTick_ = true;
this->bActive_ = false;
@@ -162,7 +162,7 @@
this->fireEvent(bIsTriggered);
}
- bool Trigger::isTriggered(TriggerMode mode)
+ bool Trigger::isTriggered(TriggerMode::Value mode)
{
// if (this->bUpdating_)
// return this->bTriggered_;
@@ -174,13 +174,13 @@
switch (mode)
{
- case TM_EventTriggerAND:
+ case TriggerMode::EventTriggerAND:
returnval = checkAnd();
break;
- case TM_EventTriggerOR:
+ case TriggerMode::EventTriggerOR:
returnval = checkOr();
break;
- case TM_EventTriggerXOR:
+ case TriggerMode::EventTriggerXOR:
returnval = checkXor();
break;
default:
@@ -269,20 +269,20 @@
void Trigger::setMode(const std::string& modeName)
{
if (modeName == "and")
- this->setMode(TM_EventTriggerAND);
+ this->setMode(TriggerMode::EventTriggerAND);
else if (modeName == "or")
- this->setMode(TM_EventTriggerOR);
+ this->setMode(TriggerMode::EventTriggerOR);
else if (modeName == "xor")
- this->setMode(TM_EventTriggerXOR);
+ this->setMode(TriggerMode::EventTriggerXOR);
}
std::string Trigger::getModeString() const
{
- if (this->mode_ == TM_EventTriggerAND)
+ if (this->mode_ == TriggerMode::EventTriggerAND)
return std::string("and");
- else if (this->mode_ == TM_EventTriggerOR)
+ else if (this->mode_ == TriggerMode::EventTriggerOR)
return std::string("or");
- else if (this->mode_ == TM_EventTriggerXOR)
+ else if (this->mode_ == TriggerMode::EventTriggerXOR)
return std::string("xor");
else
return std::string("and");
Modified: branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h
===================================================================
--- branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/objects/worldentities/triggers/Trigger.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,12 +40,15 @@
namespace orxonox
{
- enum TriggerMode
+ namespace TriggerMode
{
- TM_EventTriggerAND,
- TM_EventTriggerOR,
- TM_EventTriggerXOR,
- };
+ enum Value
+ {
+ EventTriggerAND,
+ EventTriggerOR,
+ EventTriggerXOR,
+ };
+ }
class _OrxonoxExport Trigger : public StaticEntity, public Tickable
{
@@ -63,9 +66,9 @@
const Trigger* getTrigger(unsigned int index) const;
void setMode(const std::string& modeName);
- inline void setMode(TriggerMode mode)
+ inline void setMode(TriggerMode::Value mode)
{ this->mode_ = mode; }
- inline TriggerMode getMode() const
+ inline TriggerMode::Value getMode() const
{ return mode_; }
inline void setInvert(bool bInvert)
@@ -102,7 +105,7 @@
protected:
inline bool isTriggered() { return this->isTriggered(this->mode_); }
- virtual bool isTriggered(TriggerMode mode);
+ virtual bool isTriggered(TriggerMode::Value mode);
virtual void triggered(bool bIsTriggered);
private:
@@ -117,7 +120,7 @@
bool bTriggered_;
bool bFirstTick_;
- TriggerMode mode_;
+ TriggerMode::Value mode_;
bool bInvertMode_;
bool bSwitch_;
bool bStayActive_;
Modified: branches/core4/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- branches/core4/src/orxonox/tools/ParticleInterface.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/tools/ParticleInterface.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -50,7 +50,7 @@
unsigned int ParticleInterface::counter_s = 0;
ParticleInterface* ParticleInterface::currentParticleInterface_s = 0;
- ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel)
+ ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::Value detaillevel)
{
RegisterObject(ParticleInterface);
Modified: branches/core4/src/orxonox/tools/ParticleInterface.h
===================================================================
--- branches/core4/src/orxonox/tools/ParticleInterface.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/orxonox/tools/ParticleInterface.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -44,7 +44,7 @@
class _OrxonoxExport ParticleInterface : public TimeFactorListener
{
public:
- ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel);
+ ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::Value detaillevel);
virtual ~ParticleInterface();
inline Ogre::ParticleSystem* getParticleSystem()
Modified: branches/core4/src/util/MultiType.cc
===================================================================
--- branches/core4/src/util/MultiType.cc 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/util/MultiType.cc 2009-06-30 13:14:45 UTC (rev 3257)
@@ -40,57 +40,57 @@
@brief Converts the current value of the MultiType to a new type.
@param type The type
*/
- bool MultiType::convert(MT_Type type)
+ bool MultiType::convert(MT_Type::Value type)
{
switch (type)
{
- case MT_null:
+ case MT_Type::Null:
this->reset(); return true;
- case MT_char:
+ case MT_Type::Char:
return this->convert<char>(); break;
- case MT_uchar:
+ case MT_Type::UnsignedChar:
return this->convert<unsigned char>(); break;
- case MT_short:
+ case MT_Type::Short:
return this->convert<short>(); break;
- case MT_ushort:
+ case MT_Type::UnsignedShort:
return this->convert<unsigned short>(); break;
- case MT_int:
+ case MT_Type::Int:
return this->convert<int>(); break;
- case MT_uint:
+ case MT_Type::UnsignedInt:
return this->convert<unsigned int>(); break;
- case MT_long:
+ case MT_Type::Long:
return this->convert<long>(); break;
- case MT_ulong:
+ case MT_Type::UnsignedLong:
return this->convert<unsigned long>(); break;
- case MT_longlong:
+ case MT_Type::LongLong:
return this->convert<long long>(); break;
- case MT_ulonglong:
+ case MT_Type::UnsignedLongLong:
return this->convert<unsigned long long>(); break;
- case MT_float:
+ case MT_Type::Float:
return this->convert<float>(); break;
- case MT_double:
+ case MT_Type::Double:
return this->convert<double>(); break;
- case MT_longdouble:
+ case MT_Type::LongDouble:
return this->convert<long double>(); break;
- case MT_bool:
+ case MT_Type::Bool:
return this->convert<bool>(); break;
- case MT_void:
+ case MT_Type::VoidPointer:
return this->convert<void*>(); break;
- case MT_string:
+ case MT_Type::String:
return this->convert<std::string>(); break;
- case MT_vector2:
+ case MT_Type::Vector2:
return this->convert<orxonox::Vector2>(); break;
- case MT_vector3:
+ case MT_Type::Vector3:
return this->convert<orxonox::Vector3>(); break;
- case MT_vector4:
+ case MT_Type::Vector4:
return this->convert<orxonox::Vector4>(); break;
- case MT_colourvalue:
+ case MT_Type::ColourValue:
return this->convert<orxonox::ColourValue>(); break;
- case MT_quaternion:
+ case MT_Type::Quaternion:
return this->convert<orxonox::Quaternion>(); break;
- case MT_radian:
+ case MT_Type::Radian:
return this->convert<orxonox::Radian>(); break;
- case MT_degree:
+ case MT_Type::Degree:
return this->convert<orxonox::Degree>(); break;
default:
this->reset(); return false; break;
@@ -103,106 +103,106 @@
*/
std::string MultiType::getTypename() const
{
- MT_Type type = (this->value_) ? this->value_->type_ : MT_null;
+ MT_Type::Value type = (this->value_) ? this->value_->type_ : MT_Type::Null;
switch (type)
{
- case MT_char:
+ case MT_Type::Char:
return "char"; break;
- case MT_uchar:
+ case MT_Type::UnsignedChar:
return "unsigned char"; break;
- case MT_short:
+ case MT_Type::Short:
return "short"; break;
- case MT_ushort:
+ case MT_Type::UnsignedShort:
return "unsigned short"; break;
- case MT_int:
+ case MT_Type::Int:
return "int"; break;
- case MT_uint:
+ case MT_Type::UnsignedInt:
return "unsigned int"; break;
- case MT_long:
+ case MT_Type::Long:
return "long"; break;
- case MT_ulong:
+ case MT_Type::UnsignedLong:
return "unsigned long"; break;
- case MT_longlong:
+ case MT_Type::LongLong:
return "long long"; break;
- case MT_ulonglong:
+ case MT_Type::UnsignedLongLong:
return "unsigned long long"; break;
- case MT_float:
+ case MT_Type::Float:
return "float"; break;
- case MT_double:
+ case MT_Type::Double:
return "double"; break;
- case MT_longdouble:
+ case MT_Type::LongDouble:
return "long double"; break;
- case MT_bool:
+ case MT_Type::Bool:
return "bool"; break;
- case MT_void:
+ case MT_Type::VoidPointer:
return "void*"; break;
- case MT_string:
+ case MT_Type::String:
return "std::string"; break;
- case MT_vector2:
+ case MT_Type::Vector2:
return "orxonox::Vector2"; break;
- case MT_vector3:
+ case MT_Type::Vector3:
return "orxonox::Vector3"; break;
- case MT_vector4:
+ case MT_Type::Vector4:
return "orxonox::Vector4"; break;
- case MT_colourvalue:
+ case MT_Type::ColourValue:
return "orxonox::ColourValue"; break;
- case MT_quaternion:
+ case MT_Type::Quaternion:
return "orxonox::Quaternion"; break;
- case MT_radian:
+ case MT_Type::Radian:
return "orxonox::Radian"; break;
- case MT_degree:
+ case MT_Type::Degree:
return "orxonox::Degree"; break;
default:
return "unknown"; break;
};
}
- MultiType::operator char() const { return (this->value_) ? ((this->value_->type_ == MT_char ) ? (static_cast<MT_Value<char> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator unsigned char() const { return (this->value_) ? ((this->value_->type_ == MT_uchar ) ? (static_cast<MT_Value<unsigned char> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator short() const { return (this->value_) ? ((this->value_->type_ == MT_short ) ? (static_cast<MT_Value<short> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator unsigned short() const { return (this->value_) ? ((this->value_->type_ == MT_ushort ) ? (static_cast<MT_Value<unsigned short> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator int() const { return (this->value_) ? ((this->value_->type_ == MT_int ) ? (static_cast<MT_Value<int> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator unsigned int() const { return (this->value_) ? ((this->value_->type_ == MT_uint ) ? (static_cast<MT_Value<unsigned int> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator long() const { return (this->value_) ? ((this->value_->type_ == MT_long ) ? (static_cast<MT_Value<long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator unsigned long() const { return (this->value_) ? ((this->value_->type_ == MT_ulong ) ? (static_cast<MT_Value<unsigned long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator long long() const { return (this->value_) ? ((this->value_->type_ == MT_longlong ) ? (static_cast<MT_Value<long long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator unsigned long long() const { return (this->value_) ? ((this->value_->type_ == MT_ulonglong ) ? (static_cast<MT_Value<unsigned long long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator float() const { return (this->value_) ? ((this->value_->type_ == MT_float ) ? (static_cast<MT_Value<float> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator double() const { return (this->value_) ? ((this->value_->type_ == MT_double ) ? (static_cast<MT_Value<double> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator long double() const { return (this->value_) ? ((this->value_->type_ == MT_longdouble ) ? (static_cast<MT_Value<long double> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator bool() const { return (this->value_) ? ((this->value_->type_ == MT_bool ) ? (static_cast<MT_Value<bool> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator void*() const { return (this->value_) ? ((this->value_->type_ == MT_void ) ? (static_cast<MT_Value<void*> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator std::string() const { return (this->value_) ? ((this->value_->type_ == MT_string ) ? (static_cast<MT_Value<std::string> *>(this->value_))->value_ : (*this->value_)) : NilValue<std::string>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Vector2() const { return (this->value_) ? ((this->value_->type_ == MT_vector2 ) ? (static_cast<MT_Value<orxonox::Vector2> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector2>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Vector3() const { return (this->value_) ? ((this->value_->type_ == MT_vector3 ) ? (static_cast<MT_Value<orxonox::Vector3> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector3>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Vector4() const { return (this->value_) ? ((this->value_->type_ == MT_vector4 ) ? (static_cast<MT_Value<orxonox::Vector4> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector4>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_colourvalue) ? (static_cast<MT_Value<orxonox::ColourValue>*>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Quaternion() const { return (this->value_) ? ((this->value_->type_ == MT_quaternion ) ? (static_cast<MT_Value<orxonox::Quaternion> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Quaternion>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Radian() const { return (this->value_) ? ((this->value_->type_ == MT_radian ) ? (static_cast<MT_Value<orxonox::Radian> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Radian>(); } /** @brief Returns the current value, converted to the requested type. */
- MultiType::operator orxonox::Degree() const { return (this->value_) ? ((this->value_->type_ == MT_degree ) ? (static_cast<MT_Value<orxonox::Degree> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Degree>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator char() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Char ) ? (static_cast<MT_Value<char> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator unsigned char() const { return (this->value_) ? ((this->value_->type_ == MT_Type::UnsignedChar ) ? (static_cast<MT_Value<unsigned char> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator short() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Short ) ? (static_cast<MT_Value<short> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator unsigned short() const { return (this->value_) ? ((this->value_->type_ == MT_Type::UnsignedShort ) ? (static_cast<MT_Value<unsigned short> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator int() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Int ) ? (static_cast<MT_Value<int> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator unsigned int() const { return (this->value_) ? ((this->value_->type_ == MT_Type::UnsignedInt ) ? (static_cast<MT_Value<unsigned int> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator long() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Long ) ? (static_cast<MT_Value<long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator unsigned long() const { return (this->value_) ? ((this->value_->type_ == MT_Type::UnsignedLong ) ? (static_cast<MT_Value<unsigned long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator long long() const { return (this->value_) ? ((this->value_->type_ == MT_Type::LongLong ) ? (static_cast<MT_Value<long long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator unsigned long long() const { return (this->value_) ? ((this->value_->type_ == MT_Type::UnsignedLongLong) ? (static_cast<MT_Value<unsigned long long> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator float() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Float ) ? (static_cast<MT_Value<float> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator double() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Double ) ? (static_cast<MT_Value<double> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator long double() const { return (this->value_) ? ((this->value_->type_ == MT_Type::LongDouble ) ? (static_cast<MT_Value<long double> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator bool() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Bool ) ? (static_cast<MT_Value<bool> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator void*() const { return (this->value_) ? ((this->value_->type_ == MT_Type::VoidPointer ) ? (static_cast<MT_Value<void*> *>(this->value_))->value_ : (*this->value_)) : 0; } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator std::string() const { return (this->value_) ? ((this->value_->type_ == MT_Type::String ) ? (static_cast<MT_Value<std::string> *>(this->value_))->value_ : (*this->value_)) : NilValue<std::string>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Vector2() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Vector2 ) ? (static_cast<MT_Value<orxonox::Vector2> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector2>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Vector3() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Vector3 ) ? (static_cast<MT_Value<orxonox::Vector3> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector3>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Vector4() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Vector4 ) ? (static_cast<MT_Value<orxonox::Vector4> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Vector4>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::ColourValue() const { return (this->value_) ? ((this->value_->type_ == MT_Type::ColourValue ) ? (static_cast<MT_Value<orxonox::ColourValue>*>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::ColourValue>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Quaternion() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Quaternion ) ? (static_cast<MT_Value<orxonox::Quaternion> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Quaternion>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Radian() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Radian ) ? (static_cast<MT_Value<orxonox::Radian> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Radian>(); } /** @brief Returns the current value, converted to the requested type. */
+ MultiType::operator orxonox::Degree() const { return (this->value_) ? ((this->value_->type_ == MT_Type::Degree ) ? (static_cast<MT_Value<orxonox::Degree> *>(this->value_))->value_ : (*this->value_)) : NilValue<orxonox::Degree>(); } /** @brief Returns the current value, converted to the requested type. */
- template <> void MultiType::createNewValueContainer(const char& value) { this->value_ = new MT_Value<char> (value, MT_char ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const unsigned char& value) { this->value_ = new MT_Value<unsigned char> (value, MT_uchar ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const short& value) { this->value_ = new MT_Value<short> (value, MT_short ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const unsigned short& value) { this->value_ = new MT_Value<unsigned short> (value, MT_ushort ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const int& value) { this->value_ = new MT_Value<int> (value, MT_int ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const unsigned int& value) { this->value_ = new MT_Value<unsigned int> (value, MT_uint ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const long& value) { this->value_ = new MT_Value<long> (value, MT_long ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const unsigned long& value) { this->value_ = new MT_Value<unsigned long> (value, MT_ulong ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const long long& value) { this->value_ = new MT_Value<long long> (value, MT_longlong ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const unsigned long long& value) { this->value_ = new MT_Value<unsigned long long> (value, MT_ulonglong ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const float& value) { this->value_ = new MT_Value<float> (value, MT_float ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const double& value) { this->value_ = new MT_Value<double> (value, MT_double ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const long double& value) { this->value_ = new MT_Value<long double> (value, MT_longdouble ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const bool& value) { this->value_ = new MT_Value<bool> (value, MT_bool ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer( void* const& value) { this->value_ = new MT_Value<void*> (value, MT_void ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const std::string& value) { this->value_ = new MT_Value<std::string> (value, MT_string ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value) { this->value_ = new MT_Value<orxonox::Vector2> (value, MT_vector2 ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value) { this->value_ = new MT_Value<orxonox::Vector3> (value, MT_vector3 ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value) { this->value_ = new MT_Value<orxonox::Vector4> (value, MT_vector4 ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value) { this->value_ = new MT_Value<orxonox::ColourValue>(value, MT_colourvalue); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value) { this->value_ = new MT_Value<orxonox::Quaternion> (value, MT_quaternion ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Radian& value) { this->value_ = new MT_Value<orxonox::Radian> (value, MT_radian ); } /** @brief Creates a new value container for the given type. */
- template <> void MultiType::createNewValueContainer(const orxonox::Degree& value) { this->value_ = new MT_Value<orxonox::Degree> (value, MT_degree ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const char& value) { this->value_ = new MT_Value<char> (value, MT_Type::Char ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const unsigned char& value) { this->value_ = new MT_Value<unsigned char> (value, MT_Type::UnsignedChar ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const short& value) { this->value_ = new MT_Value<short> (value, MT_Type::Short ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const unsigned short& value) { this->value_ = new MT_Value<unsigned short> (value, MT_Type::UnsignedShort ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const int& value) { this->value_ = new MT_Value<int> (value, MT_Type::Int ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const unsigned int& value) { this->value_ = new MT_Value<unsigned int> (value, MT_Type::UnsignedInt ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const long& value) { this->value_ = new MT_Value<long> (value, MT_Type::Long ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const unsigned long& value) { this->value_ = new MT_Value<unsigned long> (value, MT_Type::UnsignedLong ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const long long& value) { this->value_ = new MT_Value<long long> (value, MT_Type::LongLong ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const unsigned long long& value) { this->value_ = new MT_Value<unsigned long long> (value, MT_Type::UnsignedLongLong); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const float& value) { this->value_ = new MT_Value<float> (value, MT_Type::Float ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const double& value) { this->value_ = new MT_Value<double> (value, MT_Type::Double ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const long double& value) { this->value_ = new MT_Value<long double> (value, MT_Type::LongDouble ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const bool& value) { this->value_ = new MT_Value<bool> (value, MT_Type::Bool ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer( void* const& value) { this->value_ = new MT_Value<void*> (value, MT_Type::VoidPointer ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const std::string& value) { this->value_ = new MT_Value<std::string> (value, MT_Type::String ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Vector2& value) { this->value_ = new MT_Value<orxonox::Vector2> (value, MT_Type::Vector2 ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Vector3& value) { this->value_ = new MT_Value<orxonox::Vector3> (value, MT_Type::Vector3 ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Vector4& value) { this->value_ = new MT_Value<orxonox::Vector4> (value, MT_Type::Vector4 ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::ColourValue& value) { this->value_ = new MT_Value<orxonox::ColourValue>(value, MT_Type::ColourValue ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Quaternion& value) { this->value_ = new MT_Value<orxonox::Quaternion> (value, MT_Type::Quaternion ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Radian& value) { this->value_ = new MT_Value<orxonox::Radian> (value, MT_Type::Radian ); } /** @brief Creates a new value container for the given type. */
+ template <> void MultiType::createNewValueContainer(const orxonox::Degree& value) { this->value_ = new MT_Value<orxonox::Degree> (value, MT_Type::Degree ); } /** @brief Creates a new value container for the given type. */
}
Modified: branches/core4/src/util/MultiType.h
===================================================================
--- branches/core4/src/util/MultiType.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/util/MultiType.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -81,33 +81,36 @@
/**
@brief Enum of all possible types of a MultiType.
*/
- enum MT_Type
+ namespace MT_Type
{
- MT_null=0,
- MT_char=1,
- MT_uchar=2,
- MT_short=3,
- MT_ushort=4,
- MT_int=5,
- MT_uint=6,
- MT_long=7,
- MT_ulong=8,
- MT_longlong=9,
- MT_ulonglong=10,
- MT_float=11,
- MT_double=12,
- MT_longdouble=13,
- MT_bool=14,
- MT_void=15,
- MT_string=16,
- MT_vector2=17,
- MT_vector3=18,
- MT_vector4=19,
- MT_colourvalue=20,
- MT_quaternion=21,
- MT_radian=22,
- MT_degree=23
- };
+ enum Value
+ {
+ Null,
+ Char,
+ UnsignedChar,
+ Short,
+ UnsignedShort,
+ Int,
+ UnsignedInt,
+ Long,
+ UnsignedLong,
+ LongLong,
+ UnsignedLongLong,
+ Float,
+ Double,
+ LongDouble,
+ Bool,
+ VoidPointer,
+ String,
+ Vector2,
+ Vector3,
+ Vector4,
+ ColourValue,
+ Quaternion,
+ Radian,
+ Degree
+ };
+ }
/**
@brief The MultiType can hold a value of many possible types and convert them to other types.
@@ -139,7 +142,7 @@
class _UtilExport MT_ValueBase
{
public:
- MT_ValueBase(MT_Type type) : type_(type), bHasDefaultValue_(false) {}
+ MT_ValueBase(MT_Type::Value type) : type_(type), bHasDefaultValue_(false) {}
virtual ~MT_ValueBase() {}
virtual MT_ValueBase* clone() const = 0;
@@ -148,7 +151,7 @@
virtual bool assimilate(const MultiType& other) = 0;
/** @brief Returns the type of the current value. */
- const MT_Type& getType() const { return this->type_; }
+ const MT_Type::Value& getType() const { return this->type_; }
/** @brief Checks whether the value is a default one. */
bool hasDefaultValue() const { return this->bHasDefaultValue_; }
@@ -231,7 +234,7 @@
virtual void exportData( uint8_t*& mem ) const=0;
virtual uint8_t getSize() const=0;
- MT_Type type_; //!< The type of the current value
+ MT_Type::Value type_; //!< The type of the current value
bool bHasDefaultValue_; //!< True if the last conversion wasn't successful
};
@@ -262,7 +265,7 @@
inline MultiType(const orxonox::Degree& value) : value_(0) { this->assignValue(value); } /** @brief Constructor: Assigns the given value and sets the type. */
inline MultiType(const char* value) : value_(0) { this->setValue(std::string(value)); } /** @brief Constructor: Converts the char array to a std::string, assigns the value and sets the type. */
inline MultiType(const MultiType& other) : value_(0) { this->setValue(other); } /** @brief Copyconstructor: Assigns value and type of the other MultiType. */
- inline MultiType(MT_Type type) : value_(0) { this->setType(type); } /** @brief Constructor: Sets the type, the next assignment will determine the value. */
+ inline MultiType(MT_Type::Value type) : value_(0) { this->setType(type); } /** @brief Constructor: Sets the type, the next assignment will determine the value. */
/** @brief Destructor: Deletes the MT_Value. */
inline ~MultiType() { if (this->value_) { delete this->value_; } }
@@ -270,7 +273,7 @@
template <typename V> inline const MultiType& operator=(const V& value) { this->setValue(value); return (*this); } /** @brief Assigns a new value. The value will be converted to the current type of the MultiType. */
template <typename V> inline const MultiType& operator=(V* value) { this->setValue(value); return (*this); } /** @brief Assigns a pointer. */
inline const MultiType& operator=(const MultiType& other) { this->setValue(other); return (*this); } /** @brief Assigns the value of the other MultiType and converts it to the current type of the MultiType. */
- inline const MultiType& operator=(MT_Type type) { this->setType(type); return (*this); } /** @brief Resets the value and changes the type. */
+ inline const MultiType& operator=(MT_Type::Value type) { this->setType(type); return (*this); } /** @brief Resets the value and changes the type. */
inline bool setValue(const char& value);
inline bool setValue(const unsigned char& value);
@@ -309,29 +312,29 @@
template <typename T> inline bool convert() { return this->setValue<T>((T)(*this)); } /** @brief Converts the current value to type T. */
inline bool convert(const MultiType& other) { return this->convert(other.getType()); } /** @brief Converts the current value to the type of the other MultiType. */
- bool convert(MT_Type type);
+ bool convert(MT_Type::Value type);
- /** @brief Current content gets deleted. New type is MT_null */
+ /** @brief Current content gets deleted. New type is MT_Type::Null */
inline void reset() { if (this->value_) delete this->value_; this->value_ = 0; }
/** @brief Current content gets overridden with default zero value */
inline void resetValue() { if (this->value_) this->value_->reset(); }
template <typename T> inline void setType() { this->assignValue(T()); } /** @brief Resets the value and changes the internal type to T. */
inline void setType(const MultiType& other) { this->setType(other.getType()); } /** @brief Resets the value and changes the internal type to the type of the other MultiType. */
- inline void setType(MT_Type type) { this->reset(); this->convert(type); this->resetValue(); } /** @brief Resets the value and changes the internal type to the given type. */
+ inline void setType(MT_Type::Value type) { this->reset(); this->convert(type); this->resetValue(); } /** @brief Resets the value and changes the internal type to the given type. */
/** @brief Returns the current type. */
- inline MT_Type getType() const { return (this->value_) ? this->value_->type_ : MT_null; }
+ inline MT_Type::Value getType() const { return (this->value_) ? this->value_->type_ : MT_Type::Null; }
/** @brief Returns true if the current type equals the given type. */
- inline bool isType(MT_Type type) const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_null); }
+ inline bool isType(MT_Type::Value type) const { return (this->value_) ? (this->value_->type_ == type) : (type == MT_Type::Null); }
/** @brief Returns true if the current type is T. */
- template <typename T> inline bool isType() const { return false; } // Only works for specialized values - see below
- std::string getTypename() const;
+ template <typename T> inline bool isType() const { return false; } // Only works for specialized values - see below
+ std::string getTypename() const;
/** @brief Saves the value of the MT to a bytestream (pointed at by mem) and increases mem pointer by size of MT */
- inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type)<=8); *(uint8_t*)(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }
+ inline void exportData(uint8_t*& mem) const { assert(sizeof(MT_Type::Value)<=8); *(uint8_t*)(mem) = this->getType(); mem+=sizeof(uint8_t); this->value_->exportData(mem); }
/** @brief Loads the value of the MT from a bytestream (pointed at by mem) and increases mem pointer by size of MT */
- inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type)<=8); this->setType(static_cast<MT_Type>(*(uint8_t*)mem)); mem+=sizeof(uint8_t); this->value_->importData(mem); }
+ inline void importData(uint8_t*& mem) { assert(sizeof(MT_Type::Value)<=8); this->setType(static_cast<MT_Type::Value>(*(uint8_t*)mem)); mem+=sizeof(uint8_t); this->value_->importData(mem); }
/** @brief Saves the value of the MT to a bytestream and increases pointer to bytestream by size of MT */
inline uint8_t*& operator << (uint8_t*& mem) { importData(mem); return mem; }
/** @brief Loads the value of the MT to a bytestream and increases pointer to bytestream by size of MT */
@@ -417,29 +420,29 @@
template <typename T> inline T* getPointer() const { return ((T*)this->getVoid()); } /** @brief Returns the current value, converted to a T* pointer. */
private:
- inline bool assignValue(const char& value) { if (this->value_ && this->value_->type_ == MT_char) { return this->value_->setValue(value); } else { this->changeValueContainer<char>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const unsigned char& value) { if (this->value_ && this->value_->type_ == MT_uchar) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const short& value) { if (this->value_ && this->value_->type_ == MT_short) { return this->value_->setValue(value); } else { this->changeValueContainer<short>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const unsigned short& value) { if (this->value_ && this->value_->type_ == MT_ushort) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const int& value) { if (this->value_ && this->value_->type_ == MT_int) { return this->value_->setValue(value); } else { this->changeValueContainer<int>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const unsigned int& value) { if (this->value_ && this->value_->type_ == MT_uint) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const long& value) { if (this->value_ && this->value_->type_ == MT_long) { return this->value_->setValue(value); } else { this->changeValueContainer<long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const unsigned long& value) { if (this->value_ && this->value_->type_ == MT_ulong) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const long long& value) { if (this->value_ && this->value_->type_ == MT_longlong) { return this->value_->setValue(value); } else { this->changeValueContainer<long long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const unsigned long long& value) { if (this->value_ && this->value_->type_ == MT_ulonglong) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const float& value) { if (this->value_ && this->value_->type_ == MT_float) { return this->value_->setValue(value); } else { this->changeValueContainer<float>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const double& value) { if (this->value_ && this->value_->type_ == MT_double) { return this->value_->setValue(value); } else { this->changeValueContainer<double>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const long double& value) { if (this->value_ && this->value_->type_ == MT_longdouble) { return this->value_->setValue(value); } else { this->changeValueContainer<long double>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const bool& value) { if (this->value_ && this->value_->type_ == MT_bool) { return this->value_->setValue(value); } else { this->changeValueContainer<bool>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue( void* const& value) { if (this->value_ && this->value_->type_ == MT_void) { return this->value_->setValue(value); } else { this->changeValueContainer<void*>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const std::string& value) { if (this->value_ && this->value_->type_ == MT_string) { return this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Vector2& value) { if (this->value_ && this->value_->type_ == MT_vector2) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Vector3& value) { if (this->value_ && this->value_->type_ == MT_vector3) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Vector4& value) { if (this->value_ && this->value_->type_ == MT_vector4) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_colourvalue) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Quaternion& value) { if (this->value_ && this->value_->type_ == MT_quaternion) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Radian& value) { if (this->value_ && this->value_->type_ == MT_radian) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
- inline bool assignValue(const orxonox::Degree& value) { if (this->value_ && this->value_->type_ == MT_degree) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const char& value) { if (this->value_ && this->value_->type_ == MT_Type::Char) { return this->value_->setValue(value); } else { this->changeValueContainer<char>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const unsigned char& value) { if (this->value_ && this->value_->type_ == MT_Type::UnsignedChar) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned char>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const short& value) { if (this->value_ && this->value_->type_ == MT_Type::Short) { return this->value_->setValue(value); } else { this->changeValueContainer<short>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const unsigned short& value) { if (this->value_ && this->value_->type_ == MT_Type::UnsignedShort) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned short>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const int& value) { if (this->value_ && this->value_->type_ == MT_Type::Int) { return this->value_->setValue(value); } else { this->changeValueContainer<int>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const unsigned int& value) { if (this->value_ && this->value_->type_ == MT_Type::UnsignedInt) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned int>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const long& value) { if (this->value_ && this->value_->type_ == MT_Type::Long) { return this->value_->setValue(value); } else { this->changeValueContainer<long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const unsigned long& value) { if (this->value_ && this->value_->type_ == MT_Type::UnsignedLong) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const long long& value) { if (this->value_ && this->value_->type_ == MT_Type::LongLong) { return this->value_->setValue(value); } else { this->changeValueContainer<long long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const unsigned long long& value) { if (this->value_ && this->value_->type_ == MT_Type::UnsignedLongLong) { return this->value_->setValue(value); } else { this->changeValueContainer<unsigned long long>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const float& value) { if (this->value_ && this->value_->type_ == MT_Type::Float) { return this->value_->setValue(value); } else { this->changeValueContainer<float>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const double& value) { if (this->value_ && this->value_->type_ == MT_Type::Double) { return this->value_->setValue(value); } else { this->changeValueContainer<double>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const long double& value) { if (this->value_ && this->value_->type_ == MT_Type::LongDouble) { return this->value_->setValue(value); } else { this->changeValueContainer<long double>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const bool& value) { if (this->value_ && this->value_->type_ == MT_Type::Bool) { return this->value_->setValue(value); } else { this->changeValueContainer<bool>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue( void* const& value) { if (this->value_ && this->value_->type_ == MT_Type::VoidPointer) { return this->value_->setValue(value); } else { this->changeValueContainer<void*>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const std::string& value) { if (this->value_ && this->value_->type_ == MT_Type::String) { return this->value_->setValue(value); } else { this->changeValueContainer<std::string>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Vector2& value) { if (this->value_ && this->value_->type_ == MT_Type::Vector2) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector2>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Vector3& value) { if (this->value_ && this->value_->type_ == MT_Type::Vector3) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector3>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Vector4& value) { if (this->value_ && this->value_->type_ == MT_Type::Vector4) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Vector4>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::ColourValue& value) { if (this->value_ && this->value_->type_ == MT_Type::ColourValue) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::ColourValue>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Quaternion& value) { if (this->value_ && this->value_->type_ == MT_Type::Quaternion) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Quaternion>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Radian& value) { if (this->value_ && this->value_->type_ == MT_Type::Radian) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Radian>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
+ inline bool assignValue(const orxonox::Degree& value) { if (this->value_ && this->value_->type_ == MT_Type::Degree) { return this->value_->setValue(value); } else { this->changeValueContainer<orxonox::Degree>(value); return true; } } /** @brief Assigns a new value by changing type and creating a new container. */
/** @brief Changes the value container. */
template <typename T> inline void changeValueContainer(const T& value) { if (this->value_) { delete this->value_; } this->createNewValueContainer<T>(value); }
@@ -452,29 +455,29 @@
/** @brief Puts the MultiType on a stream by using the native << operator of the current type. */
_UtilExport inline std::ostream& operator<<(std::ostream& outstream, const MultiType& mt) { if (mt.value_) { mt.value_->toString(outstream); } return outstream; }
- template <> inline bool MultiType::isType<char>() const { return (this->value_ && this->value_->type_ == MT_char); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<unsigned char>() const { return (this->value_ && this->value_->type_ == MT_uchar); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<short>() const { return (this->value_ && this->value_->type_ == MT_short); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<unsigned short>() const { return (this->value_ && this->value_->type_ == MT_ushort); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<int>() const { return (this->value_ && this->value_->type_ == MT_int); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<unsigned int>() const { return (this->value_ && this->value_->type_ == MT_uint); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<long>() const { return (this->value_ && this->value_->type_ == MT_long); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<unsigned long>() const { return (this->value_ && this->value_->type_ == MT_ulong); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<long long>() const { return (this->value_ && this->value_->type_ == MT_longlong); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<unsigned long long>() const { return (this->value_ && this->value_->type_ == MT_ulonglong); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<float>() const { return (this->value_ && this->value_->type_ == MT_float); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<double>() const { return (this->value_ && this->value_->type_ == MT_double); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<long double>() const { return (this->value_ && this->value_->type_ == MT_longdouble); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<bool>() const { return (this->value_ && this->value_->type_ == MT_bool); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<void*>() const { return (this->value_ && this->value_->type_ == MT_void); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<std::string>() const { return (this->value_ && this->value_->type_ == MT_string); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Vector2>() const { return (this->value_ && this->value_->type_ == MT_vector2); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Vector3>() const { return (this->value_ && this->value_->type_ == MT_vector3); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Vector4>() const { return (this->value_ && this->value_->type_ == MT_vector4); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_colourvalue); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Quaternion>() const { return (this->value_ && this->value_->type_ == MT_quaternion); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Radian>() const { return (this->value_ && this->value_->type_ == MT_radian); } /** @brief Returns true if the current type equals the given type. */
- template <> inline bool MultiType::isType<orxonox::Degree>() const { return (this->value_ && this->value_->type_ == MT_degree); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<char>() const { return (this->value_ && this->value_->type_ == MT_Type::Char); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<unsigned char>() const { return (this->value_ && this->value_->type_ == MT_Type::UnsignedChar); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<short>() const { return (this->value_ && this->value_->type_ == MT_Type::Short); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<unsigned short>() const { return (this->value_ && this->value_->type_ == MT_Type::UnsignedShort); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<int>() const { return (this->value_ && this->value_->type_ == MT_Type::Int); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<unsigned int>() const { return (this->value_ && this->value_->type_ == MT_Type::UnsignedInt); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<long>() const { return (this->value_ && this->value_->type_ == MT_Type::Long); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<unsigned long>() const { return (this->value_ && this->value_->type_ == MT_Type::UnsignedLong); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<long long>() const { return (this->value_ && this->value_->type_ == MT_Type::LongLong); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<unsigned long long>() const { return (this->value_ && this->value_->type_ == MT_Type::UnsignedLongLong); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<float>() const { return (this->value_ && this->value_->type_ == MT_Type::Float); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<double>() const { return (this->value_ && this->value_->type_ == MT_Type::Double); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<long double>() const { return (this->value_ && this->value_->type_ == MT_Type::LongDouble); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<bool>() const { return (this->value_ && this->value_->type_ == MT_Type::Bool); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<void*>() const { return (this->value_ && this->value_->type_ == MT_Type::VoidPointer); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<std::string>() const { return (this->value_ && this->value_->type_ == MT_Type::String); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Vector2>() const { return (this->value_ && this->value_->type_ == MT_Type::Vector2); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Vector3>() const { return (this->value_ && this->value_->type_ == MT_Type::Vector3); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Vector4>() const { return (this->value_ && this->value_->type_ == MT_Type::Vector4); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::ColourValue>() const { return (this->value_ && this->value_->type_ == MT_Type::ColourValue); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Quaternion>() const { return (this->value_ && this->value_->type_ == MT_Type::Quaternion); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Radian>() const { return (this->value_ && this->value_->type_ == MT_Type::Radian); } /** @brief Returns true if the current type equals the given type. */
+ template <> inline bool MultiType::isType<orxonox::Degree>() const { return (this->value_ && this->value_->type_ == MT_Type::Degree); } /** @brief Returns true if the current type equals the given type. */
// Specialization to avoid ambiguities with the conversion operator
template <> inline bool MultiType::convert<std::string>() { return this->setValue<std::string> (this->operator std::string()); } /** @brief Converts the current value to the given type. */
Modified: branches/core4/src/util/MultiTypeValue.h
===================================================================
--- branches/core4/src/util/MultiTypeValue.h 2009-06-30 12:44:06 UTC (rev 3256)
+++ branches/core4/src/util/MultiTypeValue.h 2009-06-30 13:14:45 UTC (rev 3257)
@@ -53,7 +53,7 @@
{
public:
/** @brief Constructor: Assigns the value and the type identifier. */
- MT_Value(const T& value, MT_Type type) : MT_ValueBase(type), value_(value) {}
+ MT_Value(const T& value, MT_Type::Value type) : MT_ValueBase(type), value_(value) {}
/** @brief Creates a copy of itself. */
inline MT_ValueBase* clone() const { return new MT_Value<T>(this->value_, this->type_); }
More information about the Orxonox-commit
mailing list