Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11068


Ignore:
Timestamp:
Jan 17, 2016, 6:41:22 PM (8 years ago)
Author:
landauf
Message:

merged remaining commits from cpp11_v2 to cpp11_v3 (for some reason they were not merged in the first attempt)

Location:
code/branches/cpp11_v3
Files:
124 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/OrxonoxConfig.h.in

    r11054 r11068  
    207207#endif
    208208
    209 // Forward declare the everywhere used std::string
    210 namespace std
    211 {
    212     template<class _Elem> struct char_traits;
    213     template<class _Ty>   class  allocator;
    214     template<class _Elem, class _Traits, class _Ax> class basic_string;
    215     typedef basic_string<char, char_traits<char>, allocator<char>> string;
    216 }
    217 
    218209// Define Boost Filesystem version
    219210#include <boost/version.hpp>
  • code/branches/cpp11_v3/src/libraries/core/CorePrereqs.h

    r11054 r11068  
    3838#include "OrxonoxConfig.h"
    3939#include <boost/version.hpp>
     40#include <string>
    4041
    4142//-----------------------------------------------------------------------
  • code/branches/cpp11_v3/src/libraries/core/XMLPort.h

    r11054 r11068  
    324324    {
    325325    public:
    326         enum ParseResult
     326        enum class ParseResult
    327327        {
    328             PR_not_started,
    329             PR_finished,
    330             PR_waiting_for_default_values
     328            not_started,
     329            finished,
     330            waiting_for_default_values
    331331        };
    332332
    333333        public:
    334334            XMLPortParamContainer()
    335                 { this->parseResult_ = PR_not_started; }
     335                { this->parseResult_ = ParseResult::not_started; }
    336336            virtual ~XMLPortParamContainer() = default;
    337337
     
    415415                            this->loadexecutor_->parse(object, attributeValue, &error, ",");
    416416                            if (!error || (mode  == XMLPort::ExpandObject))
    417                                 this->parseResult_ = PR_finished;
     417                                this->parseResult_ = ParseResult::finished;
    418418                            else
    419                                 this->parseResult_ = PR_waiting_for_default_values;
     419                                this->parseResult_ = ParseResult::waiting_for_default_values;
    420420                        }
    421421                        else if (mode == XMLPort::ExpandObject)
    422                             this->parseResult_ = PR_finished;
     422                            this->parseResult_ = ParseResult::finished;
    423423                        else
    424                             this->parseResult_ = PR_waiting_for_default_values;
     424                            this->parseResult_ = ParseResult::waiting_for_default_values;
    425425                    }
    426426                    catch (ticpp::Exception& ex)
     
    449449            XMLPortParamContainer& portIfWaitingForDefaultValues(const ParseResult& result, const ParseParams& params)
    450450            {
    451                 if (result == PR_waiting_for_default_values)
     451                if (result == ParseResult::waiting_for_default_values)
    452452                    return this->port(this->owner_, params);
    453453                else
  • code/branches/cpp11_v3/src/libraries/core/command/ConsoleCommand.h

    r11054 r11068  
    6060    }
    6161
    62     namespace AccessLevel
     62    /**
     63        @brief Possible access levels: A command can only be executed if the program is in the state which is requested by the access level.
     64    */
     65    enum class AccessLevel
    6366    {
    64         /**
    65             @brief Possible access levels: A command can only be executed if the program is in the state which is requested by the access level.
    66         */
    67         enum Enum
    68         {
    69             All,
    70             Standalone,
    71             Master,
    72             Server,
    73             Client,
    74             Online,
    75             Offline,
    76             None
    77         };
    78     }
     67        All,
     68        Standalone,
     69        Master,
     70        Server,
     71        Client,
     72        Online,
     73        Offline,
     74        None
     75    };
    7976
    8077    /**
     
    249246
    250247                    /// Changes the access level of the command.
    251                     inline ConsoleCommandManipulator& accessLevel(AccessLevel::Enum level)
     248                    inline ConsoleCommandManipulator& accessLevel(AccessLevel level)
    252249                        { if (this->command_) { this->command_->accessLevel(level); } return *this; }
    253250
     
    332329
    333330            /// Changes the access level of the command.
    334             inline ConsoleCommand& accessLevel(AccessLevel::Enum level)
     331            inline ConsoleCommand& accessLevel(AccessLevel level)
    335332                { this->accessLevel_ = level; return *this; }
    336333            /// Returns the access level of the command.
    337             inline AccessLevel::Enum getAccessLevel() const
     334            inline AccessLevel getAccessLevel() const
    338335                { return this->accessLevel_; }
    339336
     
    394391            bool bActive_;                                                  ///< True if the command should be active (it can still be inactive, for example if the function is missing)
    395392            bool bHidden_;                                                  ///< True if the command is hidden (it is still executable, but not visible in the list of available commands)
    396             AccessLevel::Enum accessLevel_;                                 ///< The access level (the state of the game in which you can access the command)
     393            AccessLevel accessLevel_;                                       ///< The access level (the state of the game in which you can access the command)
    397394            std::string baseName_;                                          ///< The name that was first assigned to the command
    398395            std::vector<CommandName> names_;                                ///< All names and aliases of this command
  • code/branches/cpp11_v3/src/libraries/core/command/Executor.h

    r11054 r11068  
    147147                { return this->functor_->hasReturnvalue(); }
    148148            /// Returns the type of the wrapped function (static or member).
    149             inline Functor::Type::Enum getType() const
     149            inline Functor::Type getType() const
    150150                { return this->functor_->getType(); }
    151151            /// Returns the name of the type of a parameter with given index (the first parameter has index 0).
  • code/branches/cpp11_v3/src/libraries/core/command/Functor.h

    r11054 r11068  
    176176    {
    177177        public:
    178             struct Type
    179             {
    180                 /// Defines the type of a function (static or member)
    181                 enum Enum
    182                 {
    183                     Static,
    184                     Member
    185                 };
     178            /// Defines the type of a function (static or member)
     179            enum class Type
     180            {
     181                Static,
     182                Member
    186183            };
    187184
     
    196193
    197194            /// Returns the type of the function: static or member.
    198             virtual Type::Enum getType() const = 0;
     195            virtual Type getType() const = 0;
    199196            /// Returns the number of parameters of the function.
    200197            virtual unsigned int getParamCount() const = 0;
     
    262259
    263260            // see Functor::getType()
    264             virtual inline Functor::Type::Enum getType() const override
     261            virtual inline Functor::Type getType() const override
    265262                { return Functor::Type::Member; }
    266263
     
    339336
    340337            // see Functor::getType()
    341             virtual inline Functor::Type::Enum getType() const override
     338            virtual inline Functor::Type getType() const override
    342339                { return Functor::Type::Static; }
    343340
  • code/branches/cpp11_v3/src/libraries/core/command/IOConsolePOSIX.cc

    r11054 r11068  
    4646    IOConsole* IOConsole::singletonPtr_s = nullptr;
    4747
    48     namespace EscapeMode
    49     {
    50         enum Value
    51         {
    52             None,
    53             First,
    54             Second
    55         };
    56     }
     48    enum class EscapeMode
     49    {
     50        None,
     51        First,
     52        Second
     53    };
    5754
    5855    IOConsole::IOConsole()
     
    9087        std::cout.flush();
    9188        if (!this->origCout_.str().empty())
    92             this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
     89            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
    9390        // Erase input and status lines
    9491        this->cout_ << "\033[1G\033[J";
     
    111108        unsigned char c;
    112109        std::string escapeSequence;
    113         EscapeMode::Value escapeMode = EscapeMode::None;
     110        EscapeMode escapeMode = EscapeMode::None;
    114111        while (std::cin.good())
    115112        {
     
    231228        if (!this->origCout_.str().empty())
    232229        {
    233             this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
     230            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
    234231            this->origCout_.str("");
    235232        }
     
    241238        switch (type)
    242239        {
    243             case Shell::Message:
    244             case Shell::DebugOutput:     this->cout_ << "\033[0m"; break;
    245 
    246             case Shell::UserError:       this->cout_ << "\033[91m"; break;
    247             case Shell::UserWarning:     this->cout_ << "\033[93m"; break;
    248             case Shell::UserStatus:      this->cout_ << "\033[92m"; break;
    249             case Shell::UserInfo:        this->cout_ << "\033[96m"; break;
    250 
    251             case Shell::InternalError:   this->cout_ << "\033[31m"; break;
    252             case Shell::InternalWarning: this->cout_ << "\033[33m"; break;
    253             case Shell::InternalStatus:  this->cout_ << "\033[32m"; break;
    254             case Shell::InternalInfo:    this->cout_ << "\033[36m"; break;
    255 
    256             case Shell::Verbose:         this->cout_ << "\033[94m"; break;
    257             case Shell::VerboseMore:     this->cout_ << "\033[34m"; break;
    258             case Shell::VerboseUltra:    this->cout_ << "\033[34m"; break;
    259 
    260             case Shell::Command:         this->cout_ << "\033[95m"; break;
    261             case Shell::Hint:            this->cout_ << "\033[35m"; break;
    262 
    263             default:                     this->cout_ << "\033[37m"; break;
     240            case Shell::LineType::Message:
     241            case Shell::LineType::DebugOutput:     this->cout_ << "\033[0m"; break;
     242
     243            case Shell::LineType::UserError:       this->cout_ << "\033[91m"; break;
     244            case Shell::LineType::UserWarning:     this->cout_ << "\033[93m"; break;
     245            case Shell::LineType::UserStatus:      this->cout_ << "\033[92m"; break;
     246            case Shell::LineType::UserInfo:        this->cout_ << "\033[96m"; break;
     247
     248            case Shell::LineType::InternalError:   this->cout_ << "\033[31m"; break;
     249            case Shell::LineType::InternalWarning: this->cout_ << "\033[33m"; break;
     250            case Shell::LineType::InternalStatus:  this->cout_ << "\033[32m"; break;
     251            case Shell::LineType::InternalInfo:    this->cout_ << "\033[36m"; break;
     252
     253            case Shell::LineType::Verbose:         this->cout_ << "\033[94m"; break;
     254            case Shell::LineType::VerboseMore:     this->cout_ << "\033[34m"; break;
     255            case Shell::LineType::VerboseUltra:    this->cout_ << "\033[34m"; break;
     256
     257            case Shell::LineType::Command:         this->cout_ << "\033[95m"; break;
     258            case Shell::LineType::Hint:            this->cout_ << "\033[35m"; break;
     259
     260            default:                               this->cout_ << "\033[37m"; break;
    264261        }
    265262
     
    384381    void IOConsole::executed()
    385382    {
    386         this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     383        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::LineType::Command);
    387384    }
    388385
  • code/branches/cpp11_v3/src/libraries/core/command/IOConsoleWindows.cc

    r11054 r11068  
    9797        std::cout.flush();
    9898        if (!this->origCout_.str().empty())
    99             this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
     99            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
    100100
    101101        this->shell_->unregisterListener(this);
     
    190190        if (!this->origCout_.str().empty())
    191191        {
    192             this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
     192            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
    193193            this->origCout_.str("");
    194194        }
     
    202202        switch (type)
    203203        {
    204             case Shell::Message:
    205             case Shell::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
    206 
    207             case Shell::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
    208             case Shell::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
    209             case Shell::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
    210             case Shell::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
    211 
    212             case Shell::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
    213             case Shell::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
    214             case Shell::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
    215             case Shell::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
    216 
    217             case Shell::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
    218             case Shell::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
    219             case Shell::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
    220 
    221             case Shell::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
    222             case Shell::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
    223 
    224             default:                     colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     204            case Shell::LineType::Message:
     205            case Shell::LineType::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     206
     207            case Shell::LineType::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
     208            case Shell::LineType::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
     209            case Shell::LineType::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
     210            case Shell::LineType::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     211
     212            case Shell::LineType::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
     213            case Shell::LineType::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
     214            case Shell::LineType::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
     215            case Shell::LineType::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
     216
     217            case Shell::LineType::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     218            case Shell::LineType::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     219            case Shell::LineType::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
     220
     221            case Shell::LineType::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
     222            case Shell::LineType::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
     223
     224            default:                               colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
    225225        }
    226226
     
    331331    void IOConsole::executed()
    332332    {
    333         this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
     333        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::LineType::Command);
    334334    }
    335335
  • code/branches/cpp11_v3/src/libraries/core/command/Shell.cc

    r11054 r11068  
    268268    {
    269269        // yes it was - push the new line to the list
    270         this->outputLines_.push_front(std::make_pair(line, static_cast<LineType>(type)));
     270        this->outputLines_.push_front(std::make_pair(line, type));
    271271
    272272        // adjust the scroll position if needed
     
    381381        const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &error);
    382382        if (error)
    383             this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", UserError);
     383            this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", LineType::UserError);
    384384        else if (result != "")
    385             this->addOutput(result, Result);
     385            this->addOutput(result, LineType::Result);
    386386
    387387        this->clearInput();
     
    392392    {
    393393        this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete());
    394         this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), Hint);
     394        this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), LineType::Hint);
    395395
    396396        this->inputChanged();
  • code/branches/cpp11_v3/src/libraries/core/command/Shell.h

    r11054 r11068  
    8888        public:
    8989            /// Defines the type of a line of text in the Shell - some types depend on the output level, others are of internal use.
    90             enum LineType
     90            enum class LineType
    9191            {
    9292                DebugOutput     = debug_output,
     
    133133            LineList::const_iterator getEndIterator() const;
    134134
    135             void addOutput(const std::string& text, LineType type = DebugOutput);
    136             void addLine(const std::string& line, LineType type = DebugOutput);
     135            void addOutput(const std::string& text, LineType type = LineType::DebugOutput);
     136            void addLine(const std::string& line, LineType type = LineType::DebugOutput);
    137137            void clearOutput();
    138138
  • code/branches/cpp11_v3/src/libraries/core/config/ConfigFileSection.h

    r9684 r11068  
    3939#include <string>
    4040#include <list>
     41#include "util/StringUtils.h"
    4142#include "ConfigFileEntry.h"
    4243
  • code/branches/cpp11_v3/src/libraries/network/Connection.cc

    r11054 r11068  
    8181  {
    8282//     this->overallMutex_->lock();
    83     outgoingEvent outEvent = { peerID, outgoingEventType::disconnectPeer, nullptr, 0 };
     83    outgoingEvent outEvent = { peerID, OutgoingEventType::disconnectPeer, nullptr, 0 };
    8484   
    8585    this->outgoingEventsMutex_->lock();
     
    9191  void Connection::disconnectPeers()
    9292  {
    93     outgoingEvent outEvent = { 0, outgoingEventType::disconnectPeers, nullptr, 0 };
     93    outgoingEvent outEvent = { 0, OutgoingEventType::disconnectPeers, nullptr, 0 };
    9494   
    9595    this->outgoingEventsMutex_->lock();
     
    101101  {
    102102//     this->overallMutex_->lock();
    103     outgoingEvent outEvent = { peerID, outgoingEventType::sendPacket, packet, channelID };
     103    outgoingEvent outEvent = { peerID, OutgoingEventType::sendPacket, packet, channelID };
    104104   
    105105    this->outgoingEventsMutex_->lock();
     
    112112  {
    113113//     this->overallMutex_->lock();
    114     outgoingEvent outEvent = { 0, outgoingEventType::broadcastPacket, packet, channelID };
     114    outgoingEvent outEvent = { 0, OutgoingEventType::broadcastPacket, packet, channelID };
    115115   
    116116    this->outgoingEventsMutex_->lock();
     
    197197    switch( event.type )
    198198    {
    199       case outgoingEventType::sendPacket:
     199      case OutgoingEventType::sendPacket:
    200200        // check whether the peer is still/already in the peer list
    201201        if( this->peerMap_.find(event.peerID) != this->peerMap_.end() )
     
    211211        }
    212212        break;
    213       case outgoingEventType::disconnectPeer:
     213      case OutgoingEventType::disconnectPeer:
    214214        if( this->peerMap_.find(event.peerID) != this->peerMap_.end() )
    215215        {
     
    223223        }
    224224        break;
    225       case outgoingEventType::disconnectPeers:
     225      case OutgoingEventType::disconnectPeers:
    226226        disconnectPeersInternal();
    227227        break;
    228       case outgoingEventType::broadcastPacket:
     228      case OutgoingEventType::broadcastPacket:
    229229        enet_host_broadcast( this->host_, event.channelID, event.packet );
    230230        break;
     
    271271      switch( inEvent.type )
    272272      {
    273         case incomingEventType::peerConnect:
     273        case IncomingEventType::peerConnect:
    274274          addPeer(inEvent.peerID);
    275275          break;
    276         case incomingEventType::peerDisconnect:
     276        case IncomingEventType::peerDisconnect:
    277277          removePeer(inEvent.peerID);
    278278          break;
    279         case incomingEventType::receivePacket:
     279        case IncomingEventType::receivePacket:
    280280          processPacket(inEvent.packet);
    281281          break;
     
    322322   
    323323    // create new peerEvent and return it
    324     incomingEvent inEvent = { peerID, incomingEventType::peerConnect, nullptr };
     324    incomingEvent inEvent = { peerID, IncomingEventType::peerConnect, nullptr };
    325325    return inEvent;
    326326  }
     
    337337   
    338338    // create new peerEvent and return it
    339     incomingEvent inEvent = { peerID, incomingEventType::peerDisconnect, nullptr };
     339    incomingEvent inEvent = { peerID, IncomingEventType::peerDisconnect, nullptr };
    340340    return inEvent;
    341341  }
     
    351351   
    352352    // create new peerEvent and return it
    353     incomingEvent inEvent = { peerID, incomingEventType::receivePacket, p };
     353    incomingEvent inEvent = { peerID, IncomingEventType::receivePacket, p };
    354354    return inEvent;
    355355  }
  • code/branches/cpp11_v3/src/libraries/network/Connection.h

    r11054 r11068  
    6060  const unsigned int NETWORK_MAX_QUEUE_PROCESS_TIME = 5;
    6161 
    62   namespace incomingEventType
     62  enum class IncomingEventType
    6363  {
    64     enum Value
    65     {
    66       receivePacket   = 1,  // incoming packet
    67       peerConnect     = 2,  // incoming connect request
    68       peerDisconnect  = 3   // incoming disconnect request
    69     };
    70    
    71   }
     64    receivePacket   = 1,  // incoming packet
     65    peerConnect     = 2,  // incoming connect request
     66    peerDisconnect  = 3   // incoming disconnect request
     67  };
    7268 
    73   namespace outgoingEventType
     69  enum class OutgoingEventType
    7470  {
    75     enum Value
    76     {
    77       sendPacket      = 1,  // outgoing packet
    78       broadcastPacket = 2,  // outgoing broadcast packet
    79       disconnectPeer  = 3,  // outgoing disconnect request
    80       disconnectPeers = 4   // outgoing disconnect request
    81     };
    82    
    83   }
     71    sendPacket      = 1,  // outgoing packet
     72    broadcastPacket = 2,  // outgoing broadcast packet
     73    disconnectPeer  = 3,  // outgoing disconnect request
     74    disconnectPeers = 4   // outgoing disconnect request
     75  };
    8476 
    8577  struct _NetworkExport incomingEvent
    8678  {
    87     uint32_t                  peerID;
    88     incomingEventType::Value type;
    89     packet::Packet*           packet;
     79    uint32_t          peerID;
     80    IncomingEventType type;
     81    packet::Packet*   packet;
    9082  };
    9183 
    9284  struct _NetworkExport outgoingEvent
    9385  {
    94     uint32_t                  peerID;
    95     outgoingEventType::Value type;
    96     ENetPacket*               packet;
    97     ENetChannelID             channelID;
     86    uint32_t          peerID;
     87    OutgoingEventType type;
     88    ENetPacket*       packet;
     89    ENetChannelID     channelID;
    9890  };
    9991 
  • code/branches/cpp11_v3/src/libraries/network/NetworkPrereqs.h

    r11054 r11068  
    8989    namespace PacketFlag
    9090    {
    91       enum Value
    92       {
    93         Reliable    = 1,
    94         Unsequenced = 2,
    95         NoAllocate  = 4
    96       };
     91      static constexpr uint32_t Reliable    = 1;
     92      static constexpr uint32_t Unsequenced = 2;
     93      static constexpr uint32_t NoAllocate  = 4;
    9794    }
    9895  }
     
    10198  {
    10299    typedef int Type;
    103     static const Type NETWORK_FUNCTION = 6;
     100    static constexpr Type NETWORK_FUNCTION = 6;
    104101  }
    105102}
  • code/branches/cpp11_v3/src/libraries/network/packet/Acknowledgement.cc

    r8858 r11068  
    3838#define PACKET_FLAGS_ACK    0
    3939#define _PACKETID           0
    40 #define _ACKID              _PACKETID + sizeof(packet::Type::Value)
     40#define _ACKID              _PACKETID + sizeof(packet::Type)
    4141
    4242Acknowledgement::Acknowledgement( unsigned int id, unsigned int peerID )
     
    4545  flags_ = flags_ | PACKET_FLAGS_ACK;
    4646  data_=new uint8_t[ getSize() ];
    47   *(Type::Value *)(data_ + _PACKETID ) = Type::Acknowledgement;
     47  *(Type *)(data_ + _PACKETID ) = Type::Acknowledgement;
    4848  *(uint32_t *)(data_ + _ACKID ) = id;
    4949  peerID_=peerID;
  • code/branches/cpp11_v3/src/libraries/network/packet/Chat.cc

    r8858 r11068  
    4040/* Some lengths */
    4141#define _PACKETID         0
    42 #define _SOURCEID         _PACKETID + sizeof(Type::Value)
     42#define _SOURCEID         _PACKETID + sizeof(Type)
    4343#define _TARGETID         _SOURCEID + sizeof(uint32_t)
    4444#define _MESSAGELENGTH    _TARGETID + sizeof(uint32_t)
     
    5757  data_=new unsigned char[ getSize() ];
    5858
    59   *(Type::Value *)(data_ + _PACKETID ) = Type::Chat;
     59  *(Type *)(data_ + _PACKETID ) = Type::Chat;
    6060  *(unsigned int *)(data_ + _SOURCEID ) = sourceID;
    6161  *(unsigned int *)(data_ + _TARGETID ) = targetID;
  • code/branches/cpp11_v3/src/libraries/network/packet/ClassID.cc

    r11054 r11068  
    7070  //set the appropriate packet id
    7171  assert(this->data_);
    72   *(Type::Value *)(this->data_ + _PACKETID ) = Type::ClassID;
     72  *(Type *)(this->data_ + _PACKETID ) = Type::ClassID;
    7373
    7474  uint8_t *temp=data_+sizeof(uint32_t);
  • code/branches/cpp11_v3/src/libraries/network/packet/DeleteObjects.cc

    r8858 r11068  
    3939#define PACKET_FLAG_DELETE  PacketFlag::Reliable
    4040#define _PACKETID           0
    41 #define _QUANTITY           _PACKETID + sizeof(Type::Value)
     41#define _QUANTITY           _PACKETID + sizeof(Type)
    4242#define _OBJECTIDS          _QUANTITY + sizeof(uint32_t)
    4343
     
    6363    return false;
    6464  orxout(verbose, context::packets) << "sending DeleteObjects: ";
    65   unsigned int size = sizeof(Type::Value) + sizeof(uint32_t)*(number+1);
     65  unsigned int size = sizeof(Type) + sizeof(uint32_t)*(number+1);
    6666  data_ = new uint8_t[size];
    6767  uint8_t *tdata = data_;
    68   *reinterpret_cast<Type::Value*>(tdata) = Type::DeleteObjects;
    69   tdata += sizeof(Type::Value);
     68  *reinterpret_cast<Type*>(tdata) = Type::DeleteObjects;
     69  tdata += sizeof(Type);
    7070  *(uint32_t *)tdata = number;
    7171  tdata += sizeof(uint32_t);
  • code/branches/cpp11_v3/src/libraries/network/packet/FunctionCalls.cc

    r10624 r11068  
    9696  assert(this->functionCalls_.size());
    9797  data_=new uint8_t[ currentSize_ ];
    98   *(Type::Value *)(data_ + _PACKETID ) = Type::FunctionCalls; // Set the Packet ID
     98  *(Type *)(data_ + _PACKETID ) = Type::FunctionCalls; // Set the Packet ID
    9999  *(uint32_t*)(data_+sizeof(uint32_t)) = this->functionCalls_.size(); // set nrOfCalls
    100100  *(uint32_t*)(data_+2*sizeof(uint32_t)) = this->minGamestateID_; // set minGamestateID_
  • code/branches/cpp11_v3/src/libraries/network/packet/FunctionIDs.cc

    r11054 r11068  
    7171  //set the appropriate packet id
    7272  assert(this->data_);
    73   *(Type::Value *)(this->data_ + _PACKETID ) = Type::FunctionIDs;
     73  *(Type *)(this->data_ + _PACKETID ) = Type::FunctionIDs;
    7474
    7575  uint8_t *temp=data_+sizeof(uint32_t);
  • code/branches/cpp11_v3/src/libraries/network/packet/Gamestate.h

    r11054 r11068  
    5656    GamestateHeader(){ data_=nullptr; }
    5757    GamestateHeader(uint8_t* data)
    58       { assert(data); data_ = data; *(uint32_t*)data_ = Type::Gamestate; }
     58      { assert(data); data_ = data; *(Type*)data_ = Type::Gamestate; }
    5959    /*GamestateHeader(uint8_t* data, GamestateHeader* h)
    6060      { assert(data); data_=data; memcpy(data_, h->data_, getSize()); }*/
    6161    void setData(uint8_t* data)
    62       { assert(data); data_ = data; *(uint32_t*)data_ = Type::Gamestate; }
     62      { assert(data); data_ = data; *(Type*)data_ = Type::Gamestate; }
    6363    static inline uint32_t getSize()
    6464      { return 21; }
  • code/branches/cpp11_v3/src/libraries/network/packet/Packet.cc

    r11054 r11068  
    157157  }
    158158#ifndef NDEBUG
    159   switch( *(Type::Value *)(data_ + _PACKETID) )
     159  switch( *(Type *)(data_ + _PACKETID) )
    160160  {
    161161    case Type::Acknowledgement:
     
    191191//     peerID = NETWORK_PEER_ID_SERVER;
    192192  Packet *p = nullptr;
    193 //   orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl;
    194   switch( *(Type::Value *)(data + _PACKETID) )
     193//   orxout(verbose_ultra, context::packets) << "packet type: " << *(Type *)&data[_PACKETID] << endl;
     194  switch( *(Type *)(data + _PACKETID) )
    195195  {
    196196    case Type::Acknowledgement:
  • code/branches/cpp11_v3/src/libraries/network/packet/Packet.h

    r8327 r11068  
    3838{
    3939
    40 namespace Direction
     40enum class Direction
    4141{
    42   enum Value
    43   {
    44     Incoming,
    45     Outgoing,
    46     Bidirectional
    47   };
    48 }
    49 namespace Type
     42  Incoming,
     43  Outgoing,
     44  Bidirectional
     45};
     46enum class Type : uint8_t
    5047{
    51   enum Value
    52   {
    53     Acknowledgement,
    54     Chat,
    55     ClassID,
    56     DeleteObjects,
    57     FunctionIDs,
    58     FunctionCalls,
    59     Gamestate,
    60     Welcome
    61   };
    62 }
     48  Acknowledgement,
     49  Chat,
     50  ClassID,
     51  DeleteObjects,
     52  FunctionIDs,
     53  FunctionCalls,
     54  Gamestate,
     55  Welcome
     56};
    6357
    6458/**
     
    9892    unsigned int peerID_;
    9993    uint32_t requiredGamestateID_;
    100     Direction::Value packetDirection_;
     94    Direction packetDirection_;
    10195    /** Pointer to the data. Be careful when deleting it because it might
    10296        point to a location that was allocated by ENet.
  • code/branches/cpp11_v3/src/libraries/network/packet/Welcome.cc

    r8858 r11068  
    4141#define PACKET_FLAGS_CLASSID  PacketFlag::Reliable
    4242#define _PACKETID             0
    43 #define _CLIENTID             _PACKETID + sizeof(Type::Value)
     43#define _CLIENTID             _PACKETID + sizeof(Type)
    4444#define _ENDIANTEST           _CLIENTID + sizeof(uint32_t)
    4545
     
    5151  data_=new uint8_t[ getSize() ];
    5252  assert(data_);
    53   *(packet::Type::Value *)(data_ + _PACKETID ) = packet::Type::Welcome;
     53  *(packet::Type *)(data_ + _PACKETID ) = packet::Type::Welcome;
    5454  *(uint32_t *)(data_ + _CLIENTID ) = static_cast<uint32_t>(clientID);
    5555  *(uint32_t *)(data_ + _ENDIANTEST ) = 0xFEDC4321;
     
    7070
    7171unsigned int Welcome::getSize() const{
    72   return sizeof(packet::Type::Value) + 2*sizeof(uint32_t);
     72  return sizeof(packet::Type) + 2*sizeof(uint32_t);
    7373}
    7474
  • code/branches/cpp11_v3/src/libraries/network/synchronisable/Synchronisable.h

    r11054 r11068  
    3838#include <queue>
    3939#include <set>
     40#include <type_traits>
    4041
    4142#include "util/mbool.h"
     
    203204  };
    204205
    205   template <class T> void Synchronisable::registerVariable(T& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
    206   {
     206  namespace detail
     207  {
     208    template <class T, bool = std::is_enum<T>::value>
     209    struct UnderlyingType;
     210    template <class T>
     211    struct UnderlyingType<T, true> { typedef typename std::underlying_type<T>::type type; };
     212    template <class T>
     213    struct UnderlyingType<T, false> { typedef T type; };
     214  }
     215
     216  template <class T>
     217  void Synchronisable::registerVariable(T& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
     218  {
     219    typedef typename detail::UnderlyingType<T>::type UnderlyingType;
    207220    if (bidirectional)
    208221    {
    209       syncList_.push_back(new SynchronisableVariableBidirectional<T>(variable, mode, cb));
     222      syncList_.push_back(new SynchronisableVariableBidirectional<UnderlyingType>(reinterpret_cast<UnderlyingType&>(variable), mode, cb));
    210223      this->dataSize_ += syncList_.back()->getSize(state_);
    211224    }
    212225    else
    213226    {
    214       syncList_.push_back(new SynchronisableVariable<T>(variable, mode, cb));
     227      syncList_.push_back(new SynchronisableVariable<UnderlyingType>(reinterpret_cast<UnderlyingType&>(variable), mode, cb));
    215228      if ( this->state_ == mode )
    216229        this->dataSize_ += syncList_.back()->getSize(state_);
     
    218231  }
    219232 
    220   template <class T> void Synchronisable::unregisterVariable(T& variable)
     233  template <class T>
     234  void Synchronisable::unregisterVariable(T& variable)
    221235  {
    222236    std::vector<SynchronisableVariableBase*>::iterator it = syncList_.begin();
     
    238252  }
    239253
    240   template <class T> void Synchronisable::registerVariable( std::set<T>& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
    241   {
     254  template <class T>
     255  void Synchronisable::registerVariable( std::set<T>& variable, uint8_t mode, NetworkCallbackBase *cb, bool bidirectional)
     256  {
     257    typedef typename detail::UnderlyingType<T>::type UnderlyingType;
    242258    SynchronisableVariableBase* sv;
    243259    if (bidirectional)
    244       sv = new SynchronisableVariableBidirectional<std::set<T>>(variable, mode, cb);
     260      sv = new SynchronisableVariableBidirectional<std::set<UnderlyingType>>(reinterpret_cast<std::set<UnderlyingType>&>(variable), mode, cb);
    245261    else
    246       sv = new SynchronisableVariable<std::set<T>>(variable, mode, cb);
     262      sv = new SynchronisableVariable<std::set<UnderlyingType>>(reinterpret_cast<std::set<UnderlyingType>&>(variable), mode, cb);
    247263    syncList_.push_back(sv);
    248264    stringList_.push_back(sv);
  • code/branches/cpp11_v3/src/libraries/util/Math.h

    r11054 r11068  
    4747#include <cstdlib>
    4848#include <random>
     49#include <type_traits>
    4950
    5051#include <OgreMath.h>
     
    178179        @c Vector3 you get <tt>Vector3(0, 0, 0)</tt>.
    179180    */
    180     template <typename T>
    181     inline T zeroise()
     181    template <typename T> /* for normal classes */ typename std::enable_if<!std::is_enum<T>::value, T>::type
     182    inline /*T*/ zeroise()
    182183    {
    183184        // If you reach this code, you abused zeroise()!
    184185        static_assert(sizeof(T) != sizeof(T), "No template specialization available for T");
     186    }
     187    /// Implementation for enum classes: uses the underlying type to create a zero value.
     188    template <typename T> /* for enum classes */ typename std::enable_if<std::is_enum<T>::value, T>::type
     189    inline /*T*/ zeroise()
     190    {
     191        return static_cast<T>(zeroise<typename std::underlying_type<T>::type>());
    185192    }
    186193
  • code/branches/cpp11_v3/src/libraries/util/MultiType.cc

    r9550 r11068  
    4343        @param type The type
    4444    */
    45     bool MultiType::convert(Type::Enum type)
     45    bool MultiType::convert(Type type)
    4646    {
    4747        switch (type)
     
    106106    std::string MultiType::getTypename() const
    107107    {
    108         Type::Enum type = (this->value_) ? this->value_->type_ : Type::Null;
     108        Type type = (this->value_) ? this->value_->type_ : Type::Null;
    109109
    110110        switch (type)
  • code/branches/cpp11_v3/src/libraries/util/MultiType.h

    r11054 r11068  
    132132        template <typename T> friend class MT_Value;
    133133
    134         struct Type
     134        /**
     135            @brief Enum of all possible types of a MultiType.
     136        */
     137        enum class Type : uint8_t
    135138        {
    136             /**
    137                 @brief Enum of all possible types of a MultiType.
    138             */
    139             enum Enum
    140             {
    141                 Null,
    142                 Char,
    143                 UnsignedChar,
    144                 Short,
    145                 UnsignedShort,
    146                 Int,
    147                 UnsignedInt,
    148                 Long,
    149                 UnsignedLong,
    150                 LongLong,
    151                 UnsignedLongLong,
    152                 Float,
    153                 Double,
    154                 LongDouble,
    155                 Bool,
    156                 VoidPointer,
    157                 String,
    158                 Vector2,
    159                 Vector3,
    160                 Vector4,
    161                 ColourValue,
    162                 Quaternion,
    163                 Radian,
    164                 Degree
    165             };
     139            Null,
     140            Char,
     141            UnsignedChar,
     142            Short,
     143            UnsignedShort,
     144            Int,
     145            UnsignedInt,
     146            Long,
     147            UnsignedLong,
     148            LongLong,
     149            UnsignedLongLong,
     150            Float,
     151            Double,
     152            LongDouble,
     153            Bool,
     154            VoidPointer,
     155            String,
     156            Vector2,
     157            Vector3,
     158            Vector4,
     159            ColourValue,
     160            Quaternion,
     161            Radian,
     162            Degree
    166163        };
    167164
     
    174171        {
    175172        public:
    176             inline MT_ValueBase(void* data, Type::Enum type) : type_(type), bLastConversionSuccessful(true), data_(data) {}
     173            inline MT_ValueBase(void* data, Type type) : type_(type), bLastConversionSuccessful(true), data_(data) {}
    177174            virtual inline ~MT_ValueBase() {}
    178175
     
    182179
    183180            /// Returns the type of the current value.
    184             inline const Type::Enum& getType() const { return this->type_; }
    185             /// Returns true if the type of the stored value is T.
    186             template <typename T> inline bool isType() const { return false; }
     181            inline const Type& getType() const { return this->type_; }
     182
     183            /// Returns true if the type of the stored value is T. Note: the actual implementations for all supported types are defined outside of the class.
     184            template <typename T> /* for normal classes */ typename std::enable_if<!std::is_enum<T>::value, bool>::type
     185            inline /*bool*/ isType() const
     186            {
     187                // If you reach this code, you used MultiType with an unsupported type T
     188                static_assert(sizeof(T) != sizeof(T), "No template specialization available for T");
     189                return false;
     190            }
     191            /// Implementation for enum classes: Returns true if the type of the stored value is the underlying type of T.
     192            template <typename T> /* for enum classes */ typename std::enable_if<std::is_enum<T>::value, bool>::type
     193            inline /*bool*/ isType() const
     194            {
     195                return this->isType<typename std::underlying_type<T>::type>();
     196            }
    187197
    188198            /// Checks whether the value is a default one.
     
    215225            virtual bool setValue(const MultiType& other)            = 0;
    216226
     227            template <typename T> /* for normal classes */ typename std::enable_if<!std::is_enum<T>::value, bool>::type
     228            inline /*bool*/ setValue(const T& value)
     229            {
     230                // If you reach this code, you used MultiType with an unsupported type T
     231                static_assert(sizeof(T) != sizeof(T), "No template specialization available for T");
     232                return false;
     233            }
     234            template <typename T> /* for enum classes */ typename std::enable_if<std::is_enum<T>::value, bool>::type
     235            inline /*bool*/ setValue(const T& value)
     236            {
     237                typedef typename std::underlying_type<T>::type UnderlyingType;
     238                return this->setValue(reinterpret_cast<const UnderlyingType&>(value));
     239            }
     240
    217241            virtual bool getValue(char*                 value) const = 0;
    218242            virtual bool getValue(unsigned char*        value) const = 0;
     
    239263            virtual bool getValue(orxonox::Degree*      value) const = 0;
    240264
     265            template <typename T> /* for normal classes */ typename std::enable_if<!std::is_enum<T>::value, bool>::type
     266            inline /*bool*/ getValue(T* value) const
     267            {
     268                // If you reach this code, you used MultiType with an unsupported type T
     269                static_assert(sizeof(T) != sizeof(T), "No template specialization available for T");
     270                return false;
     271            }
     272            template <typename T> /* for enum classes */ typename std::enable_if<std::is_enum<T>::value, bool>::type
     273            inline /*bool*/ getValue(T* value) const
     274            {
     275                typedef typename std::underlying_type<T>::type UnderlyingType;
     276                return this->getValue(reinterpret_cast<UnderlyingType*>(value));
     277            }
     278
    241279            template <typename T> T get() const
    242280            {
     
    257295            virtual uint8_t getSize() const = 0;
    258296
    259             Type::Enum type_;               ///< The type of the current value
     297            Type type_;                     ///< The type of the current value
    260298            bool bLastConversionSuccessful; ///< True if the last conversion was successful
    261299            void* data_;                    ///< For direct access to the value if the type is known
     
    354392            template <typename T> inline bool getValue(T* value) const { if (this->value_) { return this->value_->getValue(value); } return false; }
    355393
    356             /// Returns the current value, converted to the requested type. This base implementation works only for pointers. All other supported types are
    357             /// implemented in  specialized functions at the bottom of this file.
    358             template <typename T> inline T get() const { return static_cast<T>(this->get<void*>()); }
     394            /// Returns the current value, converted to the requested type.
     395            template <typename T> /* for normal types */ typename std::enable_if<!std::is_pointer<T>::value, T>::type
     396            inline /*T*/ get() const { return (this->value_ ? this->value_->get<T>() : NilValue<T>()); }
     397            /// Returns the current value, converted to a pointer of the requested type.
     398            template <typename T> /* for pointers */ typename std::enable_if<std::is_pointer<T>::value, T>::type
     399            inline /*T*/ get() const { return this->value_ ? static_cast<T>(this->value_->get<void*>()) : nullptr; }
    359400
    360401
     
    365406            inline void exportData(uint8_t*& mem) const
    366407            {
    367                 assert(sizeof(Type::Enum) <= 8);
    368                 *static_cast<uint8_t*>(mem) = this->getType();
     408                assert(sizeof(Type) <= 8);
     409                *static_cast<uint8_t*>(mem) = static_cast<uint8_t>(this->getType());
    369410                mem += sizeof(uint8_t);
    370411                this->value_->exportData(mem);
     
    373414            inline void importData(uint8_t*& mem)
    374415            {
    375                 assert(sizeof(Type::Enum) <= 8);
    376                 this->setType(static_cast<Type::Enum>(*static_cast<uint8_t*>(mem)));
     416                assert(sizeof(Type) <= 8);
     417                this->setType(static_cast<Type>(*static_cast<uint8_t*>(mem)));
    377418                mem += sizeof(uint8_t);
    378419                this->value_->importData(mem);
     
    414455
    415456            /// Resets the value and changes the internal type to the given type.
    416             inline void setType(Type::Enum type) { this->reset(); this->convert(type); this->resetValue(); }
     457            inline void setType(Type type) { this->reset(); this->convert(type); this->resetValue(); }
    417458            /// Returns the current type.
    418             inline Type::Enum getType() const { return (this->value_) ? this->value_->type_ : Type::Null; }
     459            inline Type getType() const { return (this->value_) ? this->value_->type_ : Type::Null; }
    419460            /// Converts the current value to the given type.
    420             bool convert(Type::Enum type);
     461            bool convert(Type type);
    421462
    422463            /// Changes the value container.
     
    428469            }
    429470            /// Creates a new value container (works only with specialized types).
    430             template <typename T> inline void createNewValueContainer(const T& value)
     471            template <typename T> /* for normal classes */ typename std::enable_if<!std::is_enum<T>::value>::type
     472            inline /*void*/ createNewValueContainer(const T& value)
    431473            {
    432474                // If you reach this code, you used MultiType with an unsupported type T
    433475                static_assert(sizeof(T) != sizeof(T), "No template specialization available for T");
     476            }
     477            /// Creates a new value container (implementation for enum classes that must be cast to the underlying type).
     478            template <typename T> /* for enum classes */ typename std::enable_if<std::is_enum<T>::value>::type
     479            inline /*void*/ createNewValueContainer(const T& value)
     480            {
     481                typedef typename std::underlying_type<T>::type UnderlyingType;
     482                this->createNewValueContainer<UnderlyingType>(reinterpret_cast<const UnderlyingType&>(value));
    434483            }
    435484
     
    475524    template <> inline bool MultiType::isType<void>() const { return this->null(); }
    476525    template <> inline bool MultiType::convert<void>() { this->reset(); return true; }
    477 
    478     template <> inline char                 MultiType::get() const { return (this->value_ ? this->value_->get<char>()                 : 0); }
    479     template <> inline unsigned char        MultiType::get() const { return (this->value_ ? this->value_->get<unsigned char>()        : 0); }
    480     template <> inline short                MultiType::get() const { return (this->value_ ? this->value_->get<short>()                : 0); }
    481     template <> inline unsigned short       MultiType::get() const { return (this->value_ ? this->value_->get<unsigned short>()       : 0); }
    482     template <> inline int                  MultiType::get() const { return (this->value_ ? this->value_->get<int>()                  : 0); }
    483     template <> inline unsigned int         MultiType::get() const { return (this->value_ ? this->value_->get<unsigned int>()         : 0); }
    484     template <> inline long                 MultiType::get() const { return (this->value_ ? this->value_->get<long>()                 : 0); }
    485     template <> inline unsigned long        MultiType::get() const { return (this->value_ ? this->value_->get<unsigned long>()        : 0); }
    486     template <> inline long long            MultiType::get() const { return (this->value_ ? this->value_->get<long long>()            : 0); }
    487     template <> inline unsigned long long   MultiType::get() const { return (this->value_ ? this->value_->get<unsigned long long>()   : 0); }
    488     template <> inline float                MultiType::get() const { return (this->value_ ? this->value_->get<float>()                : 0); }
    489     template <> inline double               MultiType::get() const { return (this->value_ ? this->value_->get<double>()               : 0); }
    490     template <> inline long double          MultiType::get() const { return (this->value_ ? this->value_->get<long double>()          : 0); }
    491     template <> inline bool                 MultiType::get() const { return (this->value_ ? this->value_->get<bool>()                 : 0); }
    492     template <> inline void*                MultiType::get() const { return (this->value_ ? this->value_->get<void*>()                : nullptr); }
    493     template <> inline std::string          MultiType::get() const { return (this->value_ ? this->value_->get<std::string>()          : NilValue<std::string>()); }
    494     template <> inline orxonox::Vector2     MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Vector2>()     : NilValue<orxonox::Vector2>()); }
    495     template <> inline orxonox::Vector3     MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Vector3>()     : NilValue<orxonox::Vector3>()); }
    496     template <> inline orxonox::Vector4     MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Vector4>()     : NilValue<orxonox::Vector4>()); }
    497     template <> inline orxonox::ColourValue MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::ColourValue>() : NilValue<orxonox::ColourValue>()); }
    498     template <> inline orxonox::Quaternion  MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Quaternion>()  : NilValue<orxonox::Quaternion>()); }
    499     template <> inline orxonox::Radian      MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Radian>()      : NilValue<orxonox::Radian>()); }
    500     template <> inline orxonox::Degree      MultiType::get() const { return (this->value_ ? this->value_->get<orxonox::Degree>()      : NilValue<orxonox::Degree>()); }
    501526
    502527    template <> _UtilExport void MultiType::createNewValueContainer(const char& value);
  • code/branches/cpp11_v3/src/libraries/util/MultiTypeValue.h

    r11054 r11068  
    5555    public:
    5656        /// Constructor: Assigns the value and the type identifier.
    57         MT_Value(const T& value, MultiType::Type::Enum type) : MT_ValueBase(&this->value_, type), value_(value) {}
     57        MT_Value(const T& value, MultiType::Type type) : MT_ValueBase(&this->value_, type), value_(value) {}
    5858
    5959        /// Creates a copy of itself.
  • code/branches/cpp11_v3/src/libraries/util/SubString.cc

    r11054 r11068  
    265265        bool inSafemode = false;
    266266
    267         if(start_state != SL_NORMAL && tokens.size() > 0)
     267        if(start_state != SPLIT_LINE_STATE::NORMAL && tokens.size() > 0)
    268268        {
    269269            token = tokens[tokens.size()-1];
    270270            tokens.pop_back();
    271271        }
    272         if(start_state != SL_NORMAL && bTokenInSafemode.size() > 0)
     272        if(start_state != SPLIT_LINE_STATE::NORMAL && bTokenInSafemode.size() > 0)
    273273        {
    274274            inSafemode = bTokenInSafemode[bTokenInSafemode.size()-1];
     
    280280            switch(state)
    281281            {
    282             case SL_NORMAL:
     282            case SPLIT_LINE_STATE::NORMAL:
    283283                if(line[i] == escapeChar)
    284284                {
    285                     state = SL_ESCAPE;
     285                    state = SPLIT_LINE_STATE::ESCAPE;
    286286                    if (!bRemoveEscapeChar)
    287287                        token += line[i];
     
    290290                else if(line[i] == safemodeChar)
    291291                {
    292                     state = SL_SAFEMODE;
     292                    state = SPLIT_LINE_STATE::SAFEMODE;
    293293                    inSafemode = true;
    294294                    if (!bRemoveSafemodeChar)
     
    298298                else if(line[i] == openparenthesisChar)
    299299                {
    300                     state = SL_PARENTHESES;
     300                    state = SPLIT_LINE_STATE::PARENTHESES;
    301301                    inSafemode = true;
    302302                    if (!bRemoveParenthesisChars)
     
    318318                    }
    319319                    token += line[i];       // EAT
    320                     state = SL_COMMENT;
     320                    state = SPLIT_LINE_STATE::COMMENT;
    321321                }
    322322                else if(delimiters.find(line[i]) != std::string::npos)
     
    334334                        inSafemode = false;
    335335                    }
    336                     state = SL_NORMAL;
     336                    state = SPLIT_LINE_STATE::NORMAL;
    337337                }
    338338                else
     
    353353                }
    354354                break;
    355             case SL_ESCAPE:
     355            case SPLIT_LINE_STATE::ESCAPE:
    356356                if (!bRemoveSafemodeChar)
    357357                    token += line[i];
     
    368368                    else token += line[i];  // EAT
    369369                }
    370                 state = SL_NORMAL;
    371                 break;
    372             case SL_SAFEMODE:
     370                state = SPLIT_LINE_STATE::NORMAL;
     371                break;
     372            case SPLIT_LINE_STATE::SAFEMODE:
    373373                if(line[i] == safemodeChar)
    374374                {
    375                     state = SL_NORMAL;
     375                    state = SPLIT_LINE_STATE::NORMAL;
    376376                    if (!bRemoveSafemodeChar)
    377377                        token += line[i];
     
    379379                else if(line[i] == escapeChar)
    380380                {
    381                     state = SL_SAFEESCAPE;
     381                    state = SPLIT_LINE_STATE::SAFEESCAPE;
    382382                }
    383383                else
     
    387387                break;
    388388
    389             case SL_SAFEESCAPE:
     389            case SPLIT_LINE_STATE::SAFEESCAPE:
    390390                if(line[i] == 'n') token += '\n';
    391391                else if(line[i] == 't') token += '\t';
     
    397397                else if(line[i] == '?') token += '\?';
    398398                else token += line[i];  // EAT
    399                 state = SL_SAFEMODE;
    400                 break;
    401 
    402             case SL_PARENTHESES:
     399                state = SPLIT_LINE_STATE::SAFEMODE;
     400                break;
     401
     402            case SPLIT_LINE_STATE::PARENTHESES:
    403403                if(line[i] == closeparenthesisChar)
    404404                {
    405                     state = SL_NORMAL;
     405                    state = SPLIT_LINE_STATE::NORMAL;
    406406                    if (!bRemoveParenthesisChars)
    407407                        token += line[i];
     
    409409                else if(line[i] == escapeChar)
    410410                {
    411                     state = SL_PARENTHESESESCAPE;
     411                    state = SPLIT_LINE_STATE::PARENTHESESESCAPE;
    412412                }
    413413                else
     
    417417                break;
    418418
    419             case SL_PARENTHESESESCAPE:
     419            case SPLIT_LINE_STATE::PARENTHESESESCAPE:
    420420                if(line[i] == 'n') token += '\n';
    421421                else if(line[i] == 't') token += '\t';
     
    427427                else if(line[i] == '?') token += '\?';
    428428                else token += line[i];  // EAT
    429                 state = SL_PARENTHESES;
    430                 break;
    431 
    432             case SL_COMMENT:
     429                state = SPLIT_LINE_STATE::PARENTHESES;
     430                break;
     431
     432            case SPLIT_LINE_STATE::COMMENT:
    433433                if(line[i] == '\n')
    434434                {
     
    441441                        inSafemode = false;
    442442                    }
    443                     state = SL_NORMAL;
     443                    state = SPLIT_LINE_STATE::NORMAL;
    444444                }
    445445                else
  • code/branches/cpp11_v3/src/libraries/util/SubString.h

    r9550 r11068  
    102102    {
    103103        /// An enumerator for the internal state of the parser
    104         enum SPLIT_LINE_STATE
     104        enum class SPLIT_LINE_STATE
    105105        {
    106             SL_NORMAL,            //!< Normal state
    107             SL_ESCAPE,            //!< After an escape character
    108             SL_SAFEMODE,          //!< In safe mode (usually between quotation marks).
    109             SL_SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
    110             SL_COMMENT,           //!< In Comment mode.
    111             SL_PARENTHESES,       //!< Between parentheses (usually '{' and '}')
    112             SL_PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing parenthesis character.
     106            NORMAL,            //!< Normal state
     107            ESCAPE,            //!< After an escape character
     108            SAFEMODE,          //!< In safe mode (usually between quotation marks).
     109            SAFEESCAPE,        //!< In safe mode with the internal escape character, that escapes even the savemode character.
     110            COMMENT,           //!< In Comment mode.
     111            PARENTHESES,       //!< Between parentheses (usually '{' and '}')
     112            PARENTHESESESCAPE, //!< Between parentheses with the internal escape character, that escapes even the closing parenthesis character.
    113113        };
    114114
     
    204204                                          bool bRemoveParenthesisChars = true,
    205205                                          char commentChar = '\0',
    206                                           SPLIT_LINE_STATE start_state = SL_NORMAL);
     206                                          SPLIT_LINE_STATE start_state = SPLIT_LINE_STATE::NORMAL);
    207207
    208208        std::vector<std::string>  tokens_;              ///< The tokens after splitting the input line
  • code/branches/cpp11_v3/src/libraries/util/UtilPrereqs.h

    r11054 r11068  
    3737
    3838#include "OrxonoxConfig.h"
     39#include <string>
    3940
    4041//-----------------------------------------------------------------------
  • code/branches/cpp11_v3/src/modules/gametypes/OldRaceCheckPoint.cc

    r10624 r11068  
    4949
    5050        this->setRadarObjectColour(ColourValue::Blue);
    51         this->setRadarObjectShape(RadarViewable::Triangle);
     51        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5252        this->setRadarVisibility(false);
    5353    }
  • code/branches/cpp11_v3/src/modules/gametypes/RaceCheckPoint.cc

    r11054 r11068  
    5353
    5454        this->setRadarObjectColour(ColourValue::Blue);
    55         this->setRadarObjectShape(RadarViewable::Triangle);
     55        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5656        this->setRadarVisibility(false);
    5757        this->settingsChanged();
  • code/branches/cpp11_v3/src/modules/jump/Jump.cc

    r11054 r11068  
    610610        const int numJ = 4;
    611611
    612         enum PlatformType
    613         {
    614             PLATFORM_EMPTY, PLATFORM_STATIC, PLATFORM_HMOVE, PLATFORM_VMOVE, PLATFORM_DISAPPEAR, PLATFORM_TIMER, PLATFORM_FAKE
     612        enum class PlatformType
     613        {
     614            EMPTY, STATIC, HMOVE, VMOVE, DISAPPEAR, TIMER, FAKE
    615615        };
    616616
    617         enum ItemType
    618         {
    619             ITEM_NOTHING, ITEM_SPRING, ITEM_PROPELLER, ITEM_ROCKET, ITEM_BOOTS, ITEM_SHIELD
     617        enum class ItemType
     618        {
     619            NOTHING, SPRING, PROPELLER, ROCKET, BOOTS, SHIELD
    620620        };
    621621
     
    631631            for (int j = 0; j < numJ; ++j)
    632632            {
    633                 matrix[i][j].type = PLATFORM_EMPTY;
     633                matrix[i][j].type = PlatformType::EMPTY;
    634634                matrix[i][j].done = false;
    635635            }
     
    637637        PlatformType platformtype1;
    638638        PlatformType platformtype2;
    639         ItemType itemType = ITEM_NOTHING;
     639        ItemType itemType = ItemType::NOTHING;
    640640
    641641        if (rand()%2 == 0)
    642642        {
    643             itemType = ITEM_SPRING;
     643            itemType = ItemType::SPRING;
    644644        }
    645645        else if (rand()%2 == 0 && sectionNumber_ > 3)
     
    648648            {
    649649            case 0:
    650                 itemType = ITEM_PROPELLER;
     650                itemType = ItemType::PROPELLER;
    651651                break;
    652652            case 1:
    653                 itemType = ITEM_ROCKET;
     653                itemType = ItemType::ROCKET;
    654654                break;
    655655            case 2:
    656                 itemType = ITEM_BOOTS;
     656                itemType = ItemType::BOOTS;
    657657                break;
    658658            case 3:
    659                 itemType = ITEM_SHIELD;
     659                itemType = ItemType::SHIELD;
    660660                break;
    661661            default:
     
    667667        {
    668668        case 0:
    669             platformtype1 = PLATFORM_STATIC;
    670             platformtype2 = PLATFORM_STATIC;
     669            platformtype1 = PlatformType::STATIC;
     670            platformtype2 = PlatformType::STATIC;
    671671            break;
    672672        case 1:
    673             platformtype1 = PLATFORM_STATIC;
    674             platformtype2 = PLATFORM_STATIC;
     673            platformtype1 = PlatformType::STATIC;
     674            platformtype2 = PlatformType::STATIC;
    675675            break;
    676676        case 2:
    677             platformtype1 = PLATFORM_STATIC;
    678             platformtype2 = PLATFORM_HMOVE;
     677            platformtype1 = PlatformType::STATIC;
     678            platformtype2 = PlatformType::HMOVE;
    679679            break;
    680680        case 3:
    681             platformtype1 = PLATFORM_STATIC;
    682             platformtype2 = PLATFORM_DISAPPEAR;
     681            platformtype1 = PlatformType::STATIC;
     682            platformtype2 = PlatformType::DISAPPEAR;
    683683            break;
    684684        case 4:
    685             platformtype1 = PLATFORM_STATIC;
    686             platformtype2 = PLATFORM_VMOVE;
     685            platformtype1 = PlatformType::STATIC;
     686            platformtype2 = PlatformType::VMOVE;
    687687            break;
    688688        case 5:
    689             platformtype1 = PLATFORM_STATIC;
    690             platformtype2 = PLATFORM_TIMER;
     689            platformtype1 = PlatformType::STATIC;
     690            platformtype2 = PlatformType::TIMER;
    691691            break;
    692692        case 6:
    693             platformtype1 = PLATFORM_HMOVE;
    694             platformtype2 = PLATFORM_STATIC;
     693            platformtype1 = PlatformType::HMOVE;
     694            platformtype2 = PlatformType::STATIC;
    695695            break;
    696696        case 7:
    697             platformtype1 = PLATFORM_HMOVE;
    698             platformtype2 = PLATFORM_HMOVE;
     697            platformtype1 = PlatformType::HMOVE;
     698            platformtype2 = PlatformType::HMOVE;
    699699            break;
    700700        case 8:
    701             platformtype1 = PLATFORM_HMOVE;
    702             platformtype2 = PLATFORM_HMOVE;
     701            platformtype1 = PlatformType::HMOVE;
     702            platformtype2 = PlatformType::HMOVE;
    703703            break;
    704704        case 9:
    705             platformtype1 = PLATFORM_HMOVE;
    706             platformtype2 = PLATFORM_DISAPPEAR;
     705            platformtype1 = PlatformType::HMOVE;
     706            platformtype2 = PlatformType::DISAPPEAR;
    707707            break;
    708708        case 10:
    709             platformtype1 = PLATFORM_HMOVE;
    710             platformtype2 = PLATFORM_VMOVE;
     709            platformtype1 = PlatformType::HMOVE;
     710            platformtype2 = PlatformType::VMOVE;
    711711            break;
    712712        case 11:
    713             platformtype1 = PLATFORM_HMOVE;
    714             platformtype2 = PLATFORM_TIMER;
     713            platformtype1 = PlatformType::HMOVE;
     714            platformtype2 = PlatformType::TIMER;
    715715            break;
    716716        case 12:
    717             platformtype1 = PLATFORM_DISAPPEAR;
    718             platformtype2 = PLATFORM_STATIC;
     717            platformtype1 = PlatformType::DISAPPEAR;
     718            platformtype2 = PlatformType::STATIC;
    719719            break;
    720720        case 13:
    721             platformtype1 = PLATFORM_DISAPPEAR;
    722             platformtype2 = PLATFORM_HMOVE;
     721            platformtype1 = PlatformType::DISAPPEAR;
     722            platformtype2 = PlatformType::HMOVE;
    723723            break;
    724724        case 14:
    725             platformtype1 = PLATFORM_DISAPPEAR;
    726             platformtype2 = PLATFORM_DISAPPEAR;
     725            platformtype1 = PlatformType::DISAPPEAR;
     726            platformtype2 = PlatformType::DISAPPEAR;
    727727            break;
    728728        case 15:
    729             platformtype1 = PLATFORM_DISAPPEAR;
    730             platformtype2 = PLATFORM_DISAPPEAR;
     729            platformtype1 = PlatformType::DISAPPEAR;
     730            platformtype2 = PlatformType::DISAPPEAR;
    731731            break;
    732732        case 16:
    733             platformtype1 = PLATFORM_DISAPPEAR;
    734             platformtype2 = PLATFORM_VMOVE;
     733            platformtype1 = PlatformType::DISAPPEAR;
     734            platformtype2 = PlatformType::VMOVE;
    735735            break;
    736736        case 17:
    737             platformtype1 = PLATFORM_DISAPPEAR;
    738             platformtype2 = PLATFORM_TIMER;
     737            platformtype1 = PlatformType::DISAPPEAR;
     738            platformtype2 = PlatformType::TIMER;
    739739            break;
    740740        case 18:
    741             platformtype1 = PLATFORM_VMOVE;
    742             platformtype2 = PLATFORM_STATIC;
     741            platformtype1 = PlatformType::VMOVE;
     742            platformtype2 = PlatformType::STATIC;
    743743            break;
    744744        case 19:
    745             platformtype1 = PLATFORM_VMOVE;
    746             platformtype2 = PLATFORM_HMOVE;
     745            platformtype1 = PlatformType::VMOVE;
     746            platformtype2 = PlatformType::HMOVE;
    747747            break;
    748748        case 20:
    749             platformtype1 = PLATFORM_VMOVE;
    750             platformtype2 = PLATFORM_DISAPPEAR;
     749            platformtype1 = PlatformType::VMOVE;
     750            platformtype2 = PlatformType::DISAPPEAR;
    751751            break;
    752752        case 21:
    753             platformtype1 = PLATFORM_VMOVE;
    754             platformtype2 = PLATFORM_VMOVE;
     753            platformtype1 = PlatformType::VMOVE;
     754            platformtype2 = PlatformType::VMOVE;
    755755            break;
    756756        case 22:
    757             platformtype1 = PLATFORM_VMOVE;
    758             platformtype2 = PLATFORM_VMOVE;
     757            platformtype1 = PlatformType::VMOVE;
     758            platformtype2 = PlatformType::VMOVE;
    759759            break;
    760760        case 23:
    761             platformtype1 = PLATFORM_VMOVE;
    762             platformtype2 = PLATFORM_TIMER;
     761            platformtype1 = PlatformType::VMOVE;
     762            platformtype2 = PlatformType::TIMER;
    763763            break;
    764764        case 24:
    765             platformtype1 = PLATFORM_TIMER;
    766             platformtype2 = PLATFORM_STATIC;
     765            platformtype1 = PlatformType::TIMER;
     766            platformtype2 = PlatformType::STATIC;
    767767            break;
    768768        case 25:
    769             platformtype1 = PLATFORM_TIMER;
    770             platformtype2 = PLATFORM_HMOVE;
     769            platformtype1 = PlatformType::TIMER;
     770            platformtype2 = PlatformType::HMOVE;
    771771            break;
    772772        case 26:
    773             platformtype1 = PLATFORM_TIMER;
    774             platformtype2 = PLATFORM_DISAPPEAR;
     773            platformtype1 = PlatformType::TIMER;
     774            platformtype2 = PlatformType::DISAPPEAR;
    775775            break;
    776776        case 27:
    777             platformtype1 = PLATFORM_TIMER;
    778             platformtype2 = PLATFORM_VMOVE;
     777            platformtype1 = PlatformType::TIMER;
     778            platformtype2 = PlatformType::VMOVE;
    779779            break;
    780780        case 28:
    781             platformtype1 = PLATFORM_TIMER;
    782             platformtype2 = PLATFORM_TIMER;
     781            platformtype1 = PlatformType::TIMER;
     782            platformtype2 = PlatformType::TIMER;
    783783            break;
    784784        default:
    785             platformtype1 = PLATFORM_TIMER;
    786             platformtype2 = PLATFORM_TIMER;
     785            platformtype1 = PlatformType::TIMER;
     786            platformtype2 = PlatformType::TIMER;
    787787            break;
    788788        }
     
    807807        if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0)
    808808        {
    809             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    810             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
     809            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     810            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
    811811        }
    812812
     
    816816            if (rand()%2 == 0)
    817817            {
    818                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    819             }
    820             else
    821             {
    822                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     818                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     819            }
     820            else
     821            {
     822                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    823823            }
    824824        }
     
    827827            if (rand()%2 == 0)
    828828            {
    829                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    830             }
    831             else
    832             {
    833                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     829                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     830            }
     831            else
     832            {
     833                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    834834            }
    835835            if (rand()%2 == 0)
    836836            {
    837                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    838             }
    839             else
    840             {
    841                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     837                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     838            }
     839            else
     840            {
     841                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    842842            }
    843843        }
     
    846846            if (rand()%2 == 0)
    847847            {
    848                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    849             }
    850             else
    851             {
    852                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     848                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     849            }
     850            else
     851            {
     852                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    853853            }
    854854            if (rand()%2 == 0)
    855855            {
    856                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    857             }
    858             else
    859             {
    860                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     856                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     857            }
     858            else
     859            {
     860                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    861861            }
    862862            if (rand()%2 == 0)
    863863            {
    864                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    865             }
    866             else
    867             {
    868                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     864                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     865            }
     866            else
     867            {
     868                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    869869            }
    870870        }
     
    889889                    switch(matrix[i][j].type)
    890890                    {
    891                     case PLATFORM_EMPTY:
     891                    case PlatformType::EMPTY:
    892892                        matrix[i][j].done = true;
    893893                        break;
    894                     case PLATFORM_STATIC:
     894                    case PlatformType::STATIC:
    895895                        xPosition = randomXPosition(numJ, j);
    896896                        zPosition = sectionBegin + i*sectionLength/numI;
     
    898898                        matrix[i][j].done = true;
    899899                        break;
    900                     case PLATFORM_FAKE:
     900                    case PlatformType::FAKE:
    901901                        xPosition = randomXPosition(numJ, j);
    902902                        zPosition = sectionBegin + i*sectionLength/numI;
     
    904904                        matrix[i][j].done = true;
    905905                        break;
    906                     case PLATFORM_TIMER:
     906                    case PlatformType::TIMER:
    907907                        xPosition = randomXPosition(numJ, j);
    908908                        zPosition = sectionBegin + i*sectionLength/numI;
     
    910910                        matrix[i][j].done = true;
    911911                        break;
    912                     case PLATFORM_DISAPPEAR:
     912                    case PlatformType::DISAPPEAR:
    913913                        xPosition = randomXPosition(numJ, j);
    914914                        zPosition = sectionBegin + i*sectionLength/numI;
     
    916916                        matrix[i][j].done = true;
    917917                        break;
    918                     case PLATFORM_HMOVE:
     918                    case PlatformType::HMOVE:
    919919                        xVelocity = randomSpeed();
    920                         if (j <= numJ-3 && matrix[i][j+1].type == PLATFORM_HMOVE && matrix[i][j+2].type == PLATFORM_HMOVE && rand()%2 == 0)
     920                        if (j <= numJ-3 && matrix[i][j+1].type == PlatformType::HMOVE && matrix[i][j+2].type == PlatformType::HMOVE && rand()%2 == 0)
    921921                        {
    922922                            leftBoundary = randomXPositionLeft(numJ, j);
     
    929929                            matrix[i][j+2].done = true;
    930930                        }
    931                         else if (j <= numJ-2 && matrix[i][j+1].type == PLATFORM_HMOVE && rand()%2 == 0)
     931                        else if (j <= numJ-2 && matrix[i][j+1].type == PlatformType::HMOVE && rand()%2 == 0)
    932932                        {
    933933                            leftBoundary = randomXPositionLeft(numJ, j);
     
    949949                        }
    950950                        break;
    951                     case PLATFORM_VMOVE:
     951                    case PlatformType::VMOVE:
    952952                        zVelocity = randomSpeed();
    953                         if (i <= numI-3 && matrix[i+1][j].type == PLATFORM_VMOVE && matrix[i+2][j].type == PLATFORM_VMOVE && rand()%2 == 0)
     953                        if (i <= numI-3 && matrix[i+1][j].type == PlatformType::VMOVE && matrix[i+2][j].type == PlatformType::VMOVE && rand()%2 == 0)
    954954                        {
    955955                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    962962                            matrix[i+2][j].done = true;
    963963                        }
    964                         else if (i <= numI-2 && matrix[i+1][j].type == PLATFORM_VMOVE && rand()%2 == 0)
     964                        else if (i <= numI-2 && matrix[i+1][j].type == PlatformType::VMOVE && rand()%2 == 0)
    965965                        {
    966966                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    10001000                switch (itemType)
    10011001                {
    1002                 case ITEM_ROCKET:
     1002                case ItemType::ROCKET:
    10031003                    addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10041004                    break;
    1005                 case ITEM_PROPELLER:
     1005                case ItemType::PROPELLER:
    10061006                    addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10071007                    break;
    1008                 case ITEM_BOOTS:
     1008                case ItemType::BOOTS:
    10091009                    addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10101010                    break;
    1011                 case ITEM_SHIELD:
     1011                case ItemType::SHIELD:
    10121012                    addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10131013                    break;
     
    10201020                switch (itemType)
    10211021                {
    1022                 case ITEM_ROCKET:
     1022                case ItemType::ROCKET:
    10231023                    addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10241024                    break;
    1025                 case ITEM_PROPELLER:
     1025                case ItemType::PROPELLER:
    10261026                    addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10271027                    break;
    1028                 case ITEM_BOOTS:
     1028                case ItemType::BOOTS:
    10291029                    addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10301030                    break;
    1031                 case ITEM_SHIELD:
     1031                case ItemType::SHIELD:
    10321032                    addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10331033                    break;
     
    10451045                switch (itemType)
    10461046                {
    1047                 case ITEM_SPRING:
     1047                case ItemType::SPRING:
    10481048                    addSpring(itemPlatform);
    10491049                    break;
    1050                 case ITEM_ROCKET:
     1050                case ItemType::ROCKET:
    10511051                    addRocket(itemPlatform);
    10521052                    break;
    1053                 case ITEM_PROPELLER:
     1053                case ItemType::PROPELLER:
    10541054                    addPropeller(itemPlatform);
    10551055                    break;
    1056                 case ITEM_BOOTS:
     1056                case ItemType::BOOTS:
    10571057                    addBoots(itemPlatform);
    10581058                    break;
    1059                 case ITEM_SHIELD:
     1059                case ItemType::SHIELD:
    10601060                    addShield(itemPlatform);
    10611061                    break;
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4Dgame.h

    r11054 r11068  
    4141namespace orxonox
    4242{
    43 
    44     namespace mini4DgamePlayerColor
    45     {
    46         enum color
    47         {
    48             none,
    49             red,
    50             blue,
    51             green
    52         };
    53     }
    54 
    5543    /**
    5644    @brief
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.cc

    r11058 r11068  
    104104                for(int k=0;k<4;k++){
    105105                    for(int l=0;l<4;l++){
    106                         if (this->board_[i][j][k][l]==mini4DgamePlayerColor::none)
     106                        if (this->board_[i][j][k][l]==Mini4DgamePlayerColor::none)
    107107                            possibleMoves.push_back(Vector4(i,j,k,l));
    108108                    }
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameAI.h

    r11058 r11068  
    8383            std::list<Vector4> getPossibleMoves();
    8484            void copyBoard();
    85             mini4DgamePlayerColor::color board_[4][4][4][4];
     85            Mini4DgamePlayerColor board_[4][4][4][4];
    8686    };
    8787}
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.cc

    r11057 r11068  
    6161                for(int k=0;k<4;k++){
    6262                    for(int l=0;l<4;l++){
    63                         this->board[i][j][k][l]=mini4DgamePlayerColor::none;
     63                        this->board[i][j][k][l]=Mini4DgamePlayerColor::none;
    6464                        this->blinkingBillboards[i][j][k][l] = nullptr;
    6565                    }
     
    7979        return (move.x<4 && move.y<4 && move.z<4 && move.w<4
    8080                && move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0
    81                 && this->board[move.x][move.y][move.z][move.w] == mini4DgamePlayerColor::none);
     81                && this->board[move.x][move.y][move.z][move.w] == Mini4DgamePlayerColor::none);
    8282    }
    8383
     
    8686        const Mini4DgamePosition& move = moves.back();
    8787        moves.pop_back();
    88         this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;
     88        this->board[move.x][move.y][move.z][move.w] = Mini4DgamePlayerColor::none;
    8989        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
    9090        this->blinkingBillboards[move.x][move.y][move.z][move.w] = nullptr;
     
    115115
    116116            moves.push_back(move);
    117             mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;
     117            Mini4DgamePlayerColor playerColor = Mini4DgamePlayerColor::none;
    118118            if(player_toggle_){
    119                 playerColor = mini4DgamePlayerColor::blue;
     119                playerColor = Mini4DgamePlayerColor::blue;
    120120                this->player_toggle_ = false;
    121121            }else{
    122                 playerColor = mini4DgamePlayerColor::green;
     122                playerColor = Mini4DgamePlayerColor::green;
    123123                this->player_toggle_ = true;
    124124            }
    125125
    126             this->board[move.x][move.y][move.z][move.w] = (mini4DgamePlayerColor::color) playerColor;
     126            this->board[move.x][move.y][move.z][move.w] = playerColor;
    127127
    128128            BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
     
    146146
    147147            switch(playerColor){
    148             case mini4DgamePlayerColor::red:
     148            case Mini4DgamePlayerColor::red:
    149149                bb->setColour(ColourValue(1,0,0)); break;
    150             case mini4DgamePlayerColor::green:
     150            case Mini4DgamePlayerColor::green:
    151151                bb->setColour(ColourValue(0,1,0)); break;
    152             case mini4DgamePlayerColor::blue:
     152            case Mini4DgamePlayerColor::blue:
    153153                bb->setColour(ColourValue(0,0,1)); break;
    154154            default: break;
     
    160160
    161161            Mini4DgameWinner winner = this->getWinner();
    162             if(winner.color_ != mini4DgamePlayerColor::none)
     162            if(winner.color_ != Mini4DgamePlayerColor::none)
    163163            {
    164164                orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
     
    188188    {
    189189        Mini4DgameWinner winner;
    190         winner.color_ = mini4DgamePlayerColor::none;
     190        winner.color_ = Mini4DgamePlayerColor::none;
    191191
    192192        //check diagonals rows-columns-height-numbers
    193193        for(int i=1; i<4; i++)
    194194        {
    195             if(this->board[i][i][i][i]==mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
     195            if(this->board[i][i][i][i]==Mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])
    196196                break;
    197197            if(i==3)
     
    209209        for(int i=1; i<4; i++)
    210210        {
    211             if(this->board[3-i][i][i][i]==mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
     211            if(this->board[3-i][i][i][i]==Mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])
    212212                break;
    213213            if(i==3)
     
    225225        for(int i=1; i<4; i++)
    226226        {
    227             if(this->board[i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
     227            if(this->board[i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])
    228228                break;
    229229            if(i==3)
     
    241241        for(int i=1; i<4; i++)
    242242        {
    243             if(this->board[i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
     243            if(this->board[i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])
    244244                break;
    245245            if(i==3)
     
    257257        for(int i=1; i<4; i++)
    258258        {
    259             if(this->board[i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
     259            if(this->board[i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])
    260260                break;
    261261            if(i==3)
     
    273273        for(int i=1; i<4; i++)
    274274        {
    275             if(this->board[3-i][3-i][i][i]==mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
     275            if(this->board[3-i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])
    276276                break;
    277277            if(i==3)
     
    289289        for(int i=1; i<4; i++)
    290290        {
    291             if(this->board[3-i][i][3-i][i]==mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
     291            if(this->board[3-i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])
    292292                break;
    293293            if(i==3)
     
    305305        for(int i=1; i<4; i++)
    306306        {
    307             if(this->board[3-i][i][i][3-i]==mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
     307            if(this->board[3-i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])
    308308                break;
    309309            if(i==3)
     
    325325            for(int i=1; i<4; i++)
    326326            {
    327                 if(this->board[i][i][i][l]==mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
     327                if(this->board[i][i][i][l]==Mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])
    328328                    break;
    329329                if(i==3)
     
    341341            for(int i=1; i<4; i++)
    342342            {
    343                 if(this->board[3-i][i][i][l]==mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
     343                if(this->board[3-i][i][i][l]==Mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])
    344344                    break;
    345345                if(i==3)
     
    357357            for(int i=1; i<4; i++)
    358358            {
    359                 if(this->board[i][3-i][i][l]==mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
     359                if(this->board[i][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])
    360360                    break;
    361361                if(i==3)
     
    373373            for(int i=1; i<4; i++)
    374374            {
    375                 if(this->board[i][i][3-i][l]==mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
     375                if(this->board[i][i][3-i][l]==Mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])
    376376                    break;
    377377                if(i==3)
     
    394394            for(int i=1; i<4; i++)
    395395            {
    396                 if(this->board[i][i][l][i]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
     396                if(this->board[i][i][l][i]==Mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
    397397                    break;
    398398                if(i==3)
     
    410410            for(int i=1; i<4; i++)
    411411            {
    412                 if(this->board[3-i][i][l][i]==mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
     412                if(this->board[3-i][i][l][i]==Mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])
    413413                    break;
    414414                if(i==3)
     
    426426            for(int i=1; i<4; i++)
    427427            {
    428                 if(this->board[i][3-i][l][i]==mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
     428                if(this->board[i][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])
    429429                    break;
    430430                if(i==3)
     
    442442            for(int i=1; i<4; i++)
    443443            {
    444                 if(this->board[i][i][l][3-i]==mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
     444                if(this->board[i][i][l][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])
    445445                    break;
    446446                if(i==3)
     
    463463            for(int i=1; i<4; i++)
    464464            {
    465                 if(this->board[i][l][i][i]==mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
     465                if(this->board[i][l][i][i]==Mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])
    466466                    break;
    467467                if(i==3)
     
    479479            for(int i=1; i<4; i++)
    480480            {
    481                 if(this->board[3-i][l][i][i]==mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
     481                if(this->board[3-i][l][i][i]==Mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])
    482482                    break;
    483483                if(i==3)
     
    495495            for(int i=1; i<4; i++)
    496496            {
    497                 if(this->board[i][l][3-i][i]==mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
     497                if(this->board[i][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])
    498498                    break;
    499499                if(i==3)
     
    511511            for(int i=1; i<4; i++)
    512512            {
    513                 if(this->board[i][l][i][3-i]==mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
     513                if(this->board[i][l][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])
    514514                    break;
    515515                if(i==3)
     
    532532            for(int i=1; i<4; i++)
    533533            {
    534                 if(this->board[l][i][i][i]==mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
     534                if(this->board[l][i][i][i]==Mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])
    535535                    break;
    536536                if(i==3)
     
    548548            for(int i=1; i<4; i++)
    549549            {
    550                 if(this->board[l][3-i][i][i]==mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
     550                if(this->board[l][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])
    551551                    break;
    552552                if(i==3)
     
    564564            for(int i=1; i<4; i++)
    565565            {
    566                 if(this->board[l][i][3-i][i]==mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
     566                if(this->board[l][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])
    567567                    break;
    568568                if(i==3)
     
    580580            for(int i=1; i<4; i++)
    581581            {
    582                 if(this->board[l][i][i][3-i]==mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
     582                if(this->board[l][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])
    583583                    break;
    584584                if(i==3)
     
    602602                for(int i=1; i<4; i++)
    603603                {
    604                     if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
     604                    if(this->board[i][i][k][l]==Mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
    605605                        break;
    606606                    if(i==3)
     
    618618                for(int i=1; i<4; i++)
    619619                {
    620                     if(this->board[3-i][i][k][l]==mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
     620                    if(this->board[3-i][i][k][l]==Mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
    621621                        break;
    622622                    if(i==3)
     
    635635                for(int i=1; i<4; i++)
    636636                {
    637                     if(this->board[i][k][i][l]==mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
     637                    if(this->board[i][k][i][l]==Mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
    638638                        break;
    639639                    if(i==3)
     
    651651                for(int i=1; i<4; i++)
    652652                {
    653                     if(this->board[3-i][k][i][l]==mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
     653                    if(this->board[3-i][k][i][l]==Mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
    654654                        break;
    655655                    if(i==3)
     
    668668                for(int i=1; i<4; i++)
    669669                {
    670                     if(this->board[i][k][l][i]==mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
     670                    if(this->board[i][k][l][i]==Mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
    671671                        break;
    672672                    if(i==3)
     
    684684                for(int i=1; i<4; i++)
    685685                {
    686                     if(this->board[3-i][k][l][i]==mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
     686                    if(this->board[3-i][k][l][i]==Mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
    687687                        break;
    688688                    if(i==3)
     
    701701                for(int i=1; i<4; i++)
    702702                {
    703                     if(this->board[k][i][i][l]==mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
     703                    if(this->board[k][i][i][l]==Mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
    704704                        break;
    705705                    if(i==3)
     
    717717                for(int i=1; i<4; i++)
    718718                {
    719                     if(this->board[k][3-i][i][l]==mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
     719                    if(this->board[k][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
    720720                        break;
    721721                    if(i==3)
     
    734734                for(int i=1; i<4; i++)
    735735                {
    736                     if(this->board[k][i][l][i]==mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
     736                    if(this->board[k][i][l][i]==Mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
    737737                        break;
    738738                    if(i==3)
     
    750750                for(int i=1; i<4; i++)
    751751                {
    752                     if(this->board[k][3-i][l][i]==mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
     752                    if(this->board[k][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
    753753                        break;
    754754                    if(i==3)
     
    767767                for(int i=1; i<4; i++)
    768768                {
    769                     if(this->board[k][l][i][i]==mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
     769                    if(this->board[k][l][i][i]==Mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
    770770                        break;
    771771                    if(i==3)
     
    783783                for(int i=1; i<4; i++)
    784784                {
    785                     if(this->board[k][l][3-i][i]==mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
     785                    if(this->board[k][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
    786786                        break;
    787787                    if(i==3)
     
    804804            for(int k=0;k<4;k++){
    805805                for(int l=0;l<4;l++){
    806                     if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none
     806                    if(this->board[0][j][k][l]!= Mini4DgamePlayerColor::none
    807807                       && this->board[0][j][k][l]==this->board[1][j][k][l]
    808808                       && this->board[1][j][k][l]==this->board[2][j][k][l]
     
    826826            for(int k=0;k<4;k++){
    827827                for(int l=0;l<4;l++){
    828                     if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none
     828                    if(this->board[i][0][k][l]!= Mini4DgamePlayerColor::none
    829829                               && this->board[i][0][k][l]==this->board[i][1][k][l]
    830830                               && this->board[i][1][k][l]==this->board[i][2][k][l]
     
    848848            for(int j=0;j<4;j++){
    849849                for(int l=0;l<4;l++){
    850                     if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none
     850                    if(this->board[i][j][0][l]!= Mini4DgamePlayerColor::none
    851851                                       && this->board[i][j][0][l]==this->board[i][j][1][l]
    852852                                       && this->board[i][j][1][l]==this->board[i][j][2][l]
     
    870870            for(int j=0;j<4;j++){
    871871                for(int k=0;k<4;k++){
    872                     if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none
     872                    if(this->board[i][j][k][0]!= Mini4DgamePlayerColor::none
    873873                                       && this->board[i][j][k][0]==this->board[i][j][k][1]
    874874                                       && this->board[i][j][k][1]==this->board[i][j][k][2]
  • code/branches/cpp11_v3/src/modules/mini4dgame/Mini4DgameBoard.h

    r11057 r11068  
    4242namespace orxonox
    4343{
     44    enum class Mini4DgamePlayerColor
     45    {
     46        none,
     47        red,
     48        blue,
     49        green
     50    };
    4451
    4552    struct Mini4DgamePosition
     
    5865        int winningHeight[4];
    5966        int winningNumber[4];
    60         int color_;
     67        Mini4DgamePlayerColor color_;
    6168    };
    6269
     
    8693            bool player_toggle_;
    8794            BlinkingBillboard* blinkingBillboards[4][4][4][4];
    88             int board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
     95            Mini4DgamePlayerColor board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]
    8996    };
    9097}
  • code/branches/cpp11_v3/src/modules/notifications/NotificationDispatcher.cc

    r11054 r11068  
    113113        // TODO: Needed?
    114114        const std::string message = this->createNotificationMessage();
    115         NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::local);
     115        NotificationListener::sendNotification(message, this->getSender(), NotificationMessageType::info, NotificationSendMode::local);
    116116
    117117        // Broadcast
     
    144144            const std::string message = this->createNotificationMessage();
    145145            // TODO: Make the type configurable.
    146             NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::network, clientId);
     146            NotificationListener::sendNotification(message, this->getSender(), NotificationMessageType::info, NotificationSendMode::network, clientId);
    147147        }
    148148        else if(GameMode::isServer())
  • code/branches/cpp11_v3/src/modules/notifications/NotificationManager.cc

    r11054 r11068  
    106106        Returns true if successful.
    107107    */
    108     bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     108    bool NotificationManager::registerNotification(const std::string& message, const std::string& sender, NotificationMessageType type)
    109109    {
    110110        // TODO: Do something with the type.
     
    124124        Returns true if the command was successfully executed.
    125125    */
    126     bool NotificationManager::executeCommand(notificationCommand::Value command, const std::string& sender)
     126    bool NotificationManager::executeCommand(NotificationCommand command, const std::string& sender)
    127127    {
    128128        bool commandExecuted = false;
    129         if(command == notificationCommand::clear)
     129        if(command == NotificationCommand::clear)
    130130        {
    131131            if(this->commandClear(sender))
     
    437437
    438438    */
    439     Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     439    Notification::Notification(const std::string& message, const std::string& sender, NotificationMessageType type)
    440440    {
    441441        this->initialize();
  • code/branches/cpp11_v3/src/modules/notifications/NotificationManager.h

    r11054 r11068  
    6262    {
    6363        public:
    64             Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
     64            Notification(const std::string& message, const std::string& sender, NotificationMessageType type);
    6565            virtual ~Notification();
    6666
     
    8989            @return Returns an enum with the type of the Notification.
    9090            */
    91             inline notificationMessageType::Value getType(void) const
     91            inline NotificationMessageType getType(void) const
    9292                { return this->type_; }
    9393
     
    9595            std::string message_; //!< The Notification message.
    9696            std::string sender_; //!< The sender of the notification.
    97             notificationMessageType::Value type_; //!< The type of the notification.
     97            NotificationMessageType type_; //!< The type of the notification.
    9898
    9999            void initialize(void); //!< Registers the object and sets some default values.
     
    128128            static NotificationManager& getInstance() { return Singleton<NotificationManager>::getInstance(); } // tolua_export
    129129
    130             virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type) override;
    131             virtual bool executeCommand(notificationCommand::Value command, const std::string& sender) override;
     130            virtual bool registerNotification(const std::string& message, const std::string& sender, NotificationMessageType type) override;
     131            virtual bool executeCommand(NotificationCommand command, const std::string& sender) override;
    132132
    133133            bool registerNotification(Notification* notification); // Registers a Notification within the NotificationManager.
  • code/branches/cpp11_v3/src/modules/objects/ForceField.cc

    r11054 r11068  
    6767        this->setMassDiameter(0);   //! We allow point-masses
    6868        this->setLength(2000);
    69         this->mode_ = forceFieldMode::tube;
     69        this->mode_ = ForceFieldMode::tube;
    7070       
    7171        this->registerVariables();
     
    115115    void ForceField::tick(float dt)
    116116    {
    117         if(this->mode_ == forceFieldMode::tube)
     117        if(this->mode_ == ForceFieldMode::tube)
    118118        {
    119119            // Iterate over all objects that could possibly be affected by the ForceField.
     
    143143            }
    144144        }
    145         else if(this->mode_ == forceFieldMode::sphere)
     145        else if(this->mode_ == ForceFieldMode::sphere)
    146146        {
    147147            // Iterate over all objects that could possibly be affected by the ForceField.
     
    159159            }
    160160        }
    161         else if(this->mode_ == forceFieldMode::invertedSphere)
     161        else if(this->mode_ == ForceFieldMode::invertedSphere)
    162162        {
    163163            // Iterate over all objects that could possibly be affected by the ForceField.
     
    176176            }
    177177        }
    178         else if(this->mode_ == forceFieldMode::newtonianGravity)
     178        else if(this->mode_ == ForceFieldMode::newtonianGravity)
    179179        {
    180180            // Iterate over all objects that could possibly be affected by the ForceField.
     
    201201            }
    202202        }
    203         else if(this->mode_ == forceFieldMode::homogen)
     203        else if(this->mode_ == ForceFieldMode::homogen)
    204204        {
    205205            // Iterate over all objects that could possibly be affected by the ForceField.
     
    227227    {
    228228        if(mode == ForceField::modeTube_s)
    229             this->mode_ = forceFieldMode::tube;
     229            this->mode_ = ForceFieldMode::tube;
    230230        else if(mode == ForceField::modeSphere_s)
    231             this->mode_ = forceFieldMode::sphere;
     231            this->mode_ = ForceFieldMode::sphere;
    232232        else if(mode == ForceField::modeInvertedSphere_s)
    233             this->mode_ = forceFieldMode::invertedSphere;
     233            this->mode_ = ForceFieldMode::invertedSphere;
    234234        else if(mode == ForceField::modeNewtonianGravity_s)
    235             this->mode_ = forceFieldMode::newtonianGravity;
     235            this->mode_ = ForceFieldMode::newtonianGravity;
    236236
    237237        else if(mode == ForceField::modeHomogen_s)
    238             this->mode_ = forceFieldMode::homogen;
     238            this->mode_ = ForceFieldMode::homogen;
    239239
    240240        else
    241241        {
    242242            orxout(internal_warning) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << endl;
    243             this->mode_ = forceFieldMode::tube;
     243            this->mode_ = ForceFieldMode::tube;
    244244        }
    245245    }
     
    255255        switch(this->mode_)
    256256        {
    257             case forceFieldMode::tube:
     257            case ForceFieldMode::tube:
    258258                return ForceField::modeTube_s;
    259             case forceFieldMode::sphere:
     259            case ForceFieldMode::sphere:
    260260                return ForceField::modeSphere_s;
    261             case forceFieldMode::invertedSphere:
     261            case ForceFieldMode::invertedSphere:
    262262                return ForceField::modeInvertedSphere_s;
    263             case forceFieldMode::newtonianGravity:
     263            case ForceFieldMode::newtonianGravity:
    264264                return ForceField::modeNewtonianGravity_s;
    265265
    266             case forceFieldMode::homogen:
     266            case ForceFieldMode::homogen:
    267267                return ForceField::modeHomogen_s;
    268268
  • code/branches/cpp11_v3/src/modules/objects/ForceField.h

    r11054 r11068  
    5252    @ingroup Objects
    5353    */
    54     namespace forceFieldMode
    55     {
    56         enum Value {
    57             tube, //!< The ForceField has a tube shape.
    58             sphere, //!< The ForceField has a spherical shape.
    59             invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior.
    60             newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
    61             homogen //!< Local homogenous Force field with changeable direction for the Space Station
    62         };
    63     }
     54    enum class ForceFieldMode {
     55        tube, //!< The ForceField has a tube shape.
     56        sphere, //!< The ForceField has a spherical shape.
     57        invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior.
     58        newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies.
     59        homogen //!< Local homogenous Force field with changeable direction for the Space Station
     60    };
    6461
    6562    /**
     
    172169            float massRadius_; //!< The radius of the stellar body for the Newtonian ForceField.
    173170            float halfLength_; //!< Half of the length of the ForceField.
    174             int mode_; //!< The mode of the ForceField.
     171            ForceFieldMode mode_; //!< The mode of the ForceField.
    175172           
    176173            //! Gravitational constant for Newtonian ForceFields.
  • code/branches/cpp11_v3/src/modules/objects/Script.h

    r11054 r11068  
    5151    @brief The mode a specific @ref orxonox::Script "Script" is in.
    5252    */
    53     namespace ScriptMode
     53    enum class ScriptMode
    5454    {
    55         enum Value
    56         {
    57             normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor".
    58             lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua.
    59         };
    60     }
     55        normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor".
     56        lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua.
     57    };
    6158
    6259    /**
     
    178175
    179176            std::string code_; //!< The code that is executed by this Script.
    180             ScriptMode::Value mode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua.
     177            ScriptMode mode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua.
    181178            std::string modeStr_; //!< The mode the Script is in, as a string. Is used for networking purposes.
    182179            bool onLoad_; //!< Whether the Scripts code is executed upon loading (creation) of this Script.
     
    193190            @param mode The mode of the Script.
    194191            */
    195             inline void setMode(ScriptMode::Value mode)
     192            inline void setMode(ScriptMode mode)
    196193                { this->mode_ = mode; }
    197194    };
  • code/branches/cpp11_v3/src/modules/objects/Turret.cc

    r10622 r11068  
    278278            //slower the closer it is to the destination
    279279            Quaternion drot = Quaternion::nlerp(dt*this->rotationThrust_/20.f, Quaternion::IDENTITY, this->rotation_);
    280             this->rotate(drot, WorldEntity::World);
     280            this->rotate(drot, WorldEntity::TransformSpace::World);
    281281            this->rotation_ = Quaternion::IDENTITY;
    282282        }
  • code/branches/cpp11_v3/src/modules/objects/triggers/CheckPoint.cc

    r10624 r11068  
    5656
    5757        this->setRadarObjectColour(ColourValue::Green);
    58         this->setRadarObjectShape(RadarViewable::Dot);
     58        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    5959        this->setRadarVisibility(false);
    6060
  • code/branches/cpp11_v3/src/modules/objects/triggers/DistanceMultiTrigger.cc

    r11054 r11068  
    5858
    5959        this->distance_ = 100.0f;
    60         this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off);
     60        this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::off);
    6161        this->targetName_ = "";
    6262        this->beaconMask_.exclude(Class(BaseObject));
     
    136136        ClassTreeMask targetMask = this->getTargetMask();
    137137        // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
    138         if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     138        if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    139139            targetMask = this->beaconMask_;
    140140
     
    145145
    146146            // If the DistanceMultiTrigger is in identify-mode and the DistanceTriggerBeacon attached to the object has the wrong name we ignore it.
    147             if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     147            if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    148148            {
    149149                if(entity->getName() != this->targetName_)
     
    155155           
    156156            // If the DistanceMultiTrigger is in exclude mode and the DistanceTriggerBeacon attached to the object has the right name, we ignore it.
    157             if(this->beaconMode_ == distanceMultiTriggerBeaconMode::exclude)
     157            if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::exclude)
    158158            {
    159159               
     
    182182
    183183                // Change the entity to the parent of the DistanceTriggerBeacon (if in identify-mode), which is the entity to which the beacon is attached.
    184                 if(this->beaconMode_ == distanceMultiTriggerBeaconMode::identify)
     184                if(this->beaconMode_ == DistanceMultiTriggerBeaconMode::identify)
    185185                    entity = entity->getParent();
    186186
     
    206206        The mode as an enum.
    207207    */
    208     void DistanceMultiTrigger::setBeaconModeDirect(distanceMultiTriggerBeaconMode::Value mode)
     208    void DistanceMultiTrigger::setBeaconModeDirect(DistanceMultiTriggerBeaconMode mode)
    209209    {
    210210        this->beaconMode_ = mode;
     
    221221        switch(this->getBeaconModeDirect())
    222222        {
    223             case distanceMultiTriggerBeaconMode::off :
     223            case DistanceMultiTriggerBeaconMode::off :
    224224                return DistanceMultiTrigger::beaconModeOff_s;
    225             case distanceMultiTriggerBeaconMode::identify:
     225            case DistanceMultiTriggerBeaconMode::identify:
    226226                return DistanceMultiTrigger::beaconModeIdentify_s;
    227             case distanceMultiTriggerBeaconMode::exclude:
     227            case DistanceMultiTriggerBeaconMode::exclude:
    228228                return DistanceMultiTrigger::beaconModeExlcude_s;
    229229            default :
     
    242242    {
    243243        if(mode == DistanceMultiTrigger::beaconModeOff_s)
    244             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::off);
     244            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::off);
    245245        else if(mode == DistanceMultiTrigger::beaconModeIdentify_s)
    246             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::identify);
     246            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::identify);
    247247        else if(mode == DistanceMultiTrigger::beaconModeExlcude_s)
    248             this->setBeaconModeDirect(distanceMultiTriggerBeaconMode::exclude);
     248            this->setBeaconModeDirect(DistanceMultiTriggerBeaconMode::exclude);
    249249        else
    250250            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceMultiTrigger." << endl;
  • code/branches/cpp11_v3/src/modules/objects/triggers/DistanceMultiTrigger.h

    r11054 r11068  
    5555    @ingroup MultiTrigger
    5656    */
    57     namespace distanceMultiTriggerBeaconMode
    58     {
    59         enum Value {
    60             off, //!< The DistanceMultiTrigger is not in <em>beacon-mode</em>.
    61             identify, //!< The DistanceTrigger is in <em>identify-mode</em>.
    62             exclude //!< The DistanceTrigger is in <em>exclude-mode</em>.
    63         };
    64     }
     57    enum class DistanceMultiTriggerBeaconMode {
     58        off, //!< The DistanceMultiTrigger is not in <em>beacon-mode</em>.
     59        identify, //!< The DistanceTrigger is in <em>identify-mode</em>.
     60        exclude //!< The DistanceTrigger is in <em>exclude-mode</em>.
     61    };
    6562
    6663    /**
     
    113110                { return this->distance_; }
    114111           
    115             void setBeaconModeDirect(distanceMultiTriggerBeaconMode::Value mode); // Set the beacon mode.
     112            void setBeaconModeDirect(DistanceMultiTriggerBeaconMode mode); // Set the beacon mode.
    116113            /**
    117114            @brief Get the beacon mode.
    118115            @return Returns the mode as an enum.
    119116            */
    120             inline distanceMultiTriggerBeaconMode::Value getBeaconModeDirect(void) const
     117            inline DistanceMultiTriggerBeaconMode getBeaconModeDirect(void) const
    121118                { return this->beaconMode_; }
    122119            void setBeaconMode(const std::string& mode); // Set the beacon mode.
     
    149146            float distance_; //!< The distance at which the DistanceMultiTrigger triggers.
    150147
    151             distanceMultiTriggerBeaconMode::Value beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in.
     148            DistanceMultiTriggerBeaconMode beaconMode_; //!< The beacon mode, the DistanceMultiTrigger is in.
    152149            std::string targetName_; //!< The target name, used in <em>single-target</em> mode.
    153150            ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
  • code/branches/cpp11_v3/src/modules/objects/triggers/DistanceTrigger.cc

    r11054 r11068  
    158158        ClassTreeMask targetMask = this->targetMask_;
    159159        // If we are in identify-mode another target mask has to be applies to find the DistanceTriggerBeacons.
    160         if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     160        if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    161161            targetMask = this->beaconMask_;
    162162
     
    167167
    168168            // If the DistanceTrigger is in identify-mode and the DistanceTriggerBeacon attached to the object has the wrong name we ignore it.
    169             if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     169            if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    170170            {
    171171                if(entity->getName() != this->targetName_)
     
    177177
    178178            // If the DistanceTrigger is in exclude mode and the DistanceTriggerBeacon attached to the object has the right name, we ignore it.
    179             if(this->beaconMode_ == distanceTriggerBeaconMode::exclude)
     179            if(this->beaconMode_ == DistanceTriggerBeaconMode::exclude)
    180180            {
    181181
     
    202202                {
    203203                    // Change the entity to the parent of the DistanceTriggerBeacon (if in identify-mode), which is the entity to which the beacon is attached.
    204                     if(this->beaconMode_ == distanceTriggerBeaconMode::identify)
     204                    if(this->beaconMode_ == DistanceTriggerBeaconMode::identify)
    205205                        entity = entity->getParent();
    206206
     
    228228        The mode as an enum.
    229229    */
    230     void DistanceTrigger::setBeaconModeDirect(distanceTriggerBeaconMode::Value mode)
     230    void DistanceTrigger::setBeaconModeDirect(DistanceTriggerBeaconMode mode)
    231231    {
    232232        this->beaconMode_ = mode;
     
    243243        switch(this->getBeaconModeDirect())
    244244        {
    245             case distanceTriggerBeaconMode::off :
     245            case DistanceTriggerBeaconMode::off :
    246246                return DistanceTrigger::beaconModeOff_s;
    247             case distanceTriggerBeaconMode::identify:
     247            case DistanceTriggerBeaconMode::identify:
    248248                return DistanceTrigger::beaconModeIdentify_s;
    249             case distanceTriggerBeaconMode::exclude:
     249            case DistanceTriggerBeaconMode::exclude:
    250250                return DistanceTrigger::beaconModeExlcude_s;
    251251            default :
     
    264264    {
    265265        if(mode == DistanceTrigger::beaconModeOff_s)
    266             this->setBeaconModeDirect(distanceTriggerBeaconMode::off);
     266            this->setBeaconModeDirect(DistanceTriggerBeaconMode::off);
    267267        else if(mode == DistanceTrigger::beaconModeIdentify_s)
    268             this->setBeaconModeDirect(distanceTriggerBeaconMode::identify);
     268            this->setBeaconModeDirect(DistanceTriggerBeaconMode::identify);
    269269        else if(mode == DistanceTrigger::beaconModeExlcude_s)
    270             this->setBeaconModeDirect(distanceTriggerBeaconMode::exclude);
     270            this->setBeaconModeDirect(DistanceTriggerBeaconMode::exclude);
    271271        else
    272272            orxout(internal_error, context::triggers) << "Invalid beacon mode in DistanceTrigger." << endl;
     
    282282        Returns true if it is triggered ,false if not.
    283283    */
    284     bool DistanceTrigger::isTriggered(TriggerMode::Value mode)
     284    bool DistanceTrigger::isTriggered(TriggerMode mode)
    285285    {
    286286        if (Trigger::isTriggered(mode))
  • code/branches/cpp11_v3/src/modules/objects/triggers/DistanceTrigger.h

    r9667 r11068  
    5555  @ingroup NormalTrigger
    5656  */
    57   namespace distanceTriggerBeaconMode
    58   {
    59       enum Value {
    60           off,
    61           identify,
    62           exclude
    63       };
    64   }
     57  enum class DistanceTriggerBeaconMode {
     58      off,
     59      identify,
     60      exclude
     61  };
    6562
    6663    /**
     
    118115                { return this->distance_; }
    119116
    120             void setBeaconModeDirect(distanceTriggerBeaconMode::Value mode); // Set the beacon mode.
     117            void setBeaconModeDirect(DistanceTriggerBeaconMode mode); // Set the beacon mode.
    121118            /**
    122119            @brief Get the beacon mode.
    123120            @return Returns the mode as an enum.
    124121            */
    125             inline distanceTriggerBeaconMode::Value getBeaconModeDirect(void) const
     122            inline DistanceTriggerBeaconMode getBeaconModeDirect(void) const
    126123            { return this->beaconMode_; }
    127124            void setBeaconMode(const std::string& mode); // Set the beacon mode.
     
    144141
    145142        protected:
    146             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the DistanceTrigger is triggered.
     143            virtual bool isTriggered(TriggerMode mode) override; // Check whether the DistanceTrigger is triggered.
    147144            /**
    148145            @brief Notifies interested parties about a change of the DistanceTrigger's target mask.
     
    160157            float distance_; //!< The range of the DistanceTrigger.
    161158           
    162             distanceTriggerBeaconMode::Value beaconMode_; //!< The beacon mode.
     159            DistanceTriggerBeaconMode beaconMode_; //!< The beacon mode.
    163160            std::string targetName_; //!< The name a DistanceTriggerBeacon needs to have to make the DistanceTrigger react to it if in beacon-mode.
    164161            ClassTreeMask beaconMask_; //!< A mask, that only accepts DistanceTriggerBeacons.
  • code/branches/cpp11_v3/src/modules/objects/triggers/EventTrigger.cc

    r9667 r11068  
    7979        It should be triggered if it is triggered according just to its sub-triggers and if the last event that came in was an event that changed from not triggered to triggered.
    8080    */
    81     bool EventTrigger::isTriggered(TriggerMode::Value mode)
     81    bool EventTrigger::isTriggered(TriggerMode mode)
    8282    {
    8383        if (Trigger::isTriggered(mode))
  • code/branches/cpp11_v3/src/modules/objects/triggers/EventTrigger.h

    r9667 r11068  
    8484
    8585        protected:
    86             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the EventTrigger should be triggered.
     86            virtual bool isTriggered(TriggerMode mode) override; // Check whether the EventTrigger should be triggered.
    8787
    8888        private:
  • code/branches/cpp11_v3/src/modules/objects/triggers/Trigger.cc

    r11057 r11068  
    193193        Returns true if the Trigger should be triggered and false if not.
    194194    */
    195     bool Trigger::isTriggered(TriggerMode::Value mode)
     195    bool Trigger::isTriggered(TriggerMode mode)
    196196    {
    197197        // If the trigger has sub-triggers.
  • code/branches/cpp11_v3/src/modules/objects/triggers/Trigger.h

    r11057 r11068  
    104104            inline bool isTriggered()
    105105                { return this->isTriggered(this->mode_); }
    106             virtual bool isTriggered(TriggerMode::Value mode); // Check whether the Trigger should be triggered, given only its sub-triggers, given a specific mode.
     106            virtual bool isTriggered(TriggerMode mode); // Check whether the Trigger should be triggered, given only its sub-triggers, given a specific mode.
    107107            virtual void triggered(bool bIsTriggered); // Fires an event with the input triggered state.
    108108
  • code/branches/cpp11_v3/src/modules/objects/triggers/TriggerBase.h

    r11058 r11068  
    5252    @ingroup Triggers
    5353    */
    54     namespace TriggerMode
     54    enum class TriggerMode
    5555    {
    56         enum Value
    57         {
    58             EventTriggerAND, //!< The <em>and</em> mode. The trigger can only trigger if all the children are active.
    59             EventTriggerOR, //!< The <em>or</em> mode. The trigger can only trigger if at least one child is active.
    60             EventTriggerXOR, //!< The <em>xor</em> mode. The trigger can only trigger if exactly one child is active.
    61         };
    62     }
     56        EventTriggerAND, //!< The <em>and</em> mode. The trigger can only trigger if all the children are active.
     57        EventTriggerOR, //!< The <em>or</em> mode. The trigger can only trigger if at least one child is active.
     58        EventTriggerXOR, //!< The <em>xor</em> mode. The trigger can only trigger if exactly one child is active.
     59    };
    6360
    6461    /**
     
    157154            @param mode The mode of the trigger.
    158155            */
    159             inline void setMode(TriggerMode::Value mode) //!< Get the mode of the trigger.
     156            inline void setMode(TriggerMode mode) //!< Get the mode of the trigger.
    160157                { this->mode_ = mode; }
    161158            const std::string& getModeString(void) const;
     
    164161            @return Returns and Enum for the mode of the trigger.
    165162            */
    166             inline TriggerMode::Value getMode(void) const
     163            inline TriggerMode getMode(void) const
    167164                { return mode_; }
    168165
     
    210207
    211208            bool bInvertMode_; //!< Bool for the invert-mode, if true the trigger is inverted.
    212             TriggerMode::Value mode_; //!< The mode of the trigger.
     209            TriggerMode mode_; //!< The mode of the trigger.
    213210
    214211            TriggerBase* parent_; //!< The parent of this trigger.
  • code/branches/cpp11_v3/src/modules/overlays/OverlayText.cc

    r11054 r11068  
    4242    RegisterClass(OverlayText);
    4343
    44     static_assert((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Left,   "check enum");
    45     static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center, "check enum");
    46     static_assert((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Right,  "check enum");
     44    static_assert((int)Ogre::TextAreaOverlayElement::Left   == (int)OverlayText::Alignment::Left,   "check enum");
     45    static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Alignment::Center, "check enum");
     46    static_assert((int)Ogre::TextAreaOverlayElement::Right  == (int)OverlayText::Alignment::Right,  "check enum");
    4747
    4848    OverlayText::OverlayText(Context* context)
     
    8585    {
    8686        if (alignment == "right")
    87             this->setAlignment(OverlayText::Right);
     87            this->setAlignment(OverlayText::Alignment::Right);
    8888        else if (alignment == "center")
    89             this->setAlignment(OverlayText::Center);
     89            this->setAlignment(OverlayText::Alignment::Center);
    9090        else // "left" and default
    91             this->setAlignment(OverlayText::Left);
     91            this->setAlignment(OverlayText::Alignment::Left);
    9292    }
    9393
     
    111111    void OverlayText::sizeChanged()
    112112    {
    113         if (this->rotState_ == Horizontal)
     113        if (this->rotState_ == RotationState::Horizontal)
    114114            this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y);
    115         else if (this->rotState_ == Vertical)
     115        else if (this->rotState_ == RotationState::Vertical)
    116116            this->overlay_->setScale(size_.y / (sizeCorrection_.y * sizeCorrection_.y), size_.y * sizeCorrection_.y);
    117117        else
  • code/branches/cpp11_v3/src/modules/overlays/OverlayText.h

    r11054 r11068  
    4242    {
    4343    public:
    44         enum Alignment
     44        enum class Alignment
    4545        {
    4646            Left,
  • code/branches/cpp11_v3/src/modules/overlays/hud/HUDRadar.cc

    r11054 r11068  
    6565        this->setMaximumDotSize3D(0.07f);
    6666
    67         this->shapeMaterials_[RadarViewable::Dot]      = "RadarDot.png";
    68         this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png";
    69         this->shapeMaterials_[RadarViewable::Square]   = "RadarSquare.png";
     67        this->shapeMaterials_[RadarViewable::Shape::Dot]      = "RadarDot.png";
     68        this->shapeMaterials_[RadarViewable::Shape::Triangle] = "RadarTriangle.png";
     69        this->shapeMaterials_[RadarViewable::Shape::Square]   = "RadarSquare.png";
    7070        this->owner_ = nullptr;
    7171
  • code/branches/cpp11_v3/src/modules/overlays/stats/CreateLines.h

    r5980 r11068  
    2929
    3030#include "overlays/OverlaysPrereqs.h"
     31
     32#include <string>
    3133
    3234namespace orxonox
  • code/branches/cpp11_v3/src/modules/pickup/Pickup.cc

    r9667 r11068  
    7878    void Pickup::initialize(void)
    7979    {
    80         this->activationType_ = pickupActivationType::immediate;
    81         this->durationType_ = pickupDurationType::once;
     80        this->activationType_ = PickupActivationType::immediate;
     81        this->durationType_ = PickupDurationType::once;
    8282    }
    8383
     
    105105        switch(this->getActivationType())
    106106        {
    107             case pickupActivationType::immediate:
     107            case PickupActivationType::immediate:
    108108                return activationTypeImmediate_s;
    109             case pickupActivationType::onUse:
     109            case PickupActivationType::onUse:
    110110                return activationTypeOnUse_s;
    111111            default:
     
    124124        switch(this->getDurationType())
    125125        {
    126             case pickupDurationType::once:
     126            case PickupDurationType::once:
    127127                return durationTypeOnce_s;
    128             case pickupDurationType::continuous:
     128            case PickupDurationType::continuous:
    129129                return durationTypeContinuous_s;
    130130            default:
     
    142142    {
    143143        if(type == Pickup::activationTypeImmediate_s)
    144             this->setActivationType(pickupActivationType::immediate);
     144            this->setActivationType(PickupActivationType::immediate);
    145145        else if(type == Pickup::activationTypeOnUse_s)
    146             this->setActivationType(pickupActivationType::onUse);
     146            this->setActivationType(PickupActivationType::onUse);
    147147        else
    148148            orxout(internal_error, context::pickups) << "Invalid activationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
     
    158158    {
    159159        if(type == Pickup::durationTypeOnce_s)
    160             this->setDurationType(pickupDurationType::once);
     160            this->setDurationType(PickupDurationType::once);
    161161        else if(type == Pickup::durationTypeContinuous_s)
    162             this->setDurationType(pickupDurationType::continuous);
     162            this->setDurationType(PickupDurationType::continuous);
    163163        else
    164164            orxout(internal_error, context::pickups) << "Invalid durationType '" << type << "' in " << this->getIdentifier()->getName() << "." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/Pickup.h

    r11054 r11068  
    5353    @ingroup Pickup
    5454    */
    55     namespace pickupActivationType
     55    enum class PickupActivationType
    5656    {
    57         enum Value
    58         {
    59             immediate, //!< Means that the @ref orxonox::Pickup "Pickup" will be used immediately after pickup.
    60             onUse, //!< Means that the @ref orxonox::Pickup "Pickup" will be used at a later point trough some external influence.
    61         };
    62     }
     57        immediate, //!< Means that the @ref orxonox::Pickup "Pickup" will be used immediately after pickup.
     58        onUse, //!< Means that the @ref orxonox::Pickup "Pickup" will be used at a later point trough some external influence.
     59    };
    6360
    6461    /**
     
    6865    @ingroup Pickup
    6966    */
    70     namespace pickupDurationType
     67    enum class PickupDurationType
    7168    {
    72         enum Value
    73         {
    74             once, //!< Means that the @ref orxonox::Pickup "Pickup" will be used only once at a singular time instant.
    75             continuous, //!< Means that the @ref orxonox::Pickup "Pickup" will be used over a continuous timespan.
    76         };
    77     }
     69        once, //!< Means that the @ref orxonox::Pickup "Pickup" will be used only once at a singular time instant.
     70        continuous, //!< Means that the @ref orxonox::Pickup "Pickup" will be used over a continuous timespan.
     71    };
    7872
    7973    /**
     
    112106            @return Returns the activation type of the Pickup.
    113107            */
    114             inline pickupActivationType::Value getActivationType(void) const
     108            inline PickupActivationType getActivationType(void) const
    115109                { return this->activationType_; }
    116110            /**
     
    118112            @return Returns the duration type of the Pickup.
    119113            */
    120             inline pickupDurationType::Value getDurationType(void) const
     114            inline PickupDurationType getDurationType(void) const
    121115                { return this->durationType_; }
    122116
     
    129123            */
    130124            inline bool isImmediate(void) const
    131                 { return this->getActivationType() == pickupActivationType::immediate; }
     125                { return this->getActivationType() == PickupActivationType::immediate; }
    132126            /**
    133127            @brief Get whether the activation type is 'onUse'.
     
    135129            */
    136130            inline bool isOnUse(void) const
    137                 { return this->getActivationType() == pickupActivationType::onUse; }
     131                { return this->getActivationType() == PickupActivationType::onUse; }
    138132            /**
    139133            @brief Get whether the duration type is 'once'.
     
    141135            */
    142136            inline bool isOnce(void) const
    143                 { return this->getDurationType() == pickupDurationType::once; }
     137                { return this->getDurationType() == PickupDurationType::once; }
    144138            /**
    145139            @brief Get whether the duration type is 'continuous'.
     
    147141            */
    148142            inline bool isContinuous(void) const
    149                 { return this->getDurationType() == pickupDurationType::continuous; }
     143                { return this->getDurationType() == PickupDurationType::continuous; }
    150144
    151145            virtual void changedPickedUp(void) override; //!< Should be called when the pickup has transited from picked up to dropped or the other way around.
     
    164158            @param type The activation type of the Pickup.
    165159            */
    166             inline void setActivationType(pickupActivationType::Value type)
     160            inline void setActivationType(PickupActivationType type)
    167161                { this->activationType_ = type; }
    168162            /**
     
    170164            @param type The duration type of the Pickup.
    171165            */
    172             inline void setDurationType(pickupDurationType::Value type)
     166            inline void setDurationType(PickupDurationType type)
    173167                { this->durationType_ = type; }
    174168
     
    180174
    181175            std::string representationName_; //!< The name of the associated PickupRepresentation.
    182             pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
    183             pickupDurationType::Value durationType_; //!< The duration type of the Pickup.
     176            PickupActivationType activationType_; //!< The activation type of the Pickup.
     177            PickupDurationType durationType_; //!< The duration type of the Pickup.
    184178
    185179            //! Strings for the activation and duration types.
  • code/branches/cpp11_v3/src/modules/pickup/items/DronePickup.cc

    r11054 r11068  
    7474    {
    7575        this->addTarget(ClassIdentifier<Pawn>::getIdentifier());
    76         this->setDurationType(pickupDurationType::once);
     76        this->setDurationType(PickupDurationType::once);
    7777        this->droneTemplate_ = "";
    7878    }
  • code/branches/cpp11_v3/src/modules/pickup/items/HealthPickup.cc

    r11054 r11068  
    7777        this->health_ = 0.0f;
    7878        this->healthRate_ = 0.0f;
    79         this->healthType_ = pickupHealthType::limited;
     79        this->healthType_ = PickupHealthType::limited;
    8080        this->maxHealthSave_ = 0.0f;
    8181        this->maxHealthOverwrite_ = 0.0f;
     
    127127            switch(this->getHealthType())
    128128            {
    129                 case pickupHealthType::permanent:
     129                case PickupHealthType::permanent:
    130130                    if(pawn->getMaxHealth() < fullHealth)
    131131                        pawn->setMaxHealth(fullHealth);
    132                 case pickupHealthType::limited:
     132                case PickupHealthType::limited:
    133133                    pawn->addHealth(health);
    134134                    break;
    135                 case pickupHealthType::temporary:
     135                case PickupHealthType::temporary:
    136136                    if(pawn->getMaxHealth() > fullHealth)
    137137                    {
     
    174174                switch(this->getHealthType())
    175175                {
    176                     case pickupHealthType::permanent:
     176                    case PickupHealthType::permanent:
    177177                        health = pawn->getHealth()+this->getHealth();
    178178                        if(pawn->getMaxHealth() < health)
    179179                            pawn->setMaxHealth(health);
    180                     case pickupHealthType::limited:
     180                    case PickupHealthType::limited:
    181181                        pawn->addHealth(this->getHealth());
    182182                        break;
    183                     case pickupHealthType::temporary:
     183                    case PickupHealthType::temporary:
    184184                        health = pawn->getHealth()+this->getHealth();
    185185                        if(pawn->getMaxHealth() < health)
     
    201201        else
    202202        {
    203             if(this->getHealthType() == pickupHealthType::temporary)
     203            if(this->getHealthType() == PickupHealthType::temporary)
    204204            {
    205205                PickupCarrier* carrier = this->getCarrier();
     
    256256        switch(this->getHealthType())
    257257        {
    258             case pickupHealthType::limited:
     258            case PickupHealthType::limited:
    259259                return HealthPickup::healthTypeLimited_s;
    260             case pickupHealthType::temporary:
     260            case PickupHealthType::temporary:
    261261                return HealthPickup::healthTypeTemporary_s;
    262             case pickupHealthType::permanent:
     262            case PickupHealthType::permanent:
    263263                return HealthPickup::healthTypePermanent_s;
    264264            default:
     
    308308    {
    309309        if(type == HealthPickup::healthTypeLimited_s)
    310             this->setHealthType(pickupHealthType::limited);
     310            this->setHealthType(PickupHealthType::limited);
    311311        else if(type == HealthPickup::healthTypeTemporary_s)
    312             this->setHealthType(pickupHealthType::temporary);
     312            this->setHealthType(PickupHealthType::temporary);
    313313        else if(type == HealthPickup::healthTypePermanent_s)
    314             this->setHealthType(pickupHealthType::permanent);
     314            this->setHealthType(PickupHealthType::permanent);
    315315        else
    316316            orxout(internal_error, context::pickups) << "Invalid healthType '" << type << "' in HealthPickup." << endl;
  • code/branches/cpp11_v3/src/modules/pickup/items/HealthPickup.h

    r9667 r11068  
    5151    @ingroup PickupItems
    5252    */
    53     namespace pickupHealthType
     53    enum class PickupHealthType
    5454    {
    55         enum Value
    56         {
    57             limited, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" only increases the users health to its maximum health.
    58             temporary, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" temporarily increases the users health even above its maximum health, but only as long as it is in use.
    59             permanent //!< Means that the @ref orxonox::HealthPickup "HealthPickup" increases the users health even above its maximum health and increases the maximum health permanently such that it matches the new health.
    60         };
    61     }
     55        limited, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" only increases the users health to its maximum health.
     56        temporary, //!< Means that the @ref orxonox::HealthPickup "HealthPickup" temporarily increases the users health even above its maximum health, but only as long as it is in use.
     57        permanent //!< Means that the @ref orxonox::HealthPickup "HealthPickup" increases the users health even above its maximum health and increases the maximum health permanently such that it matches the new health.
     58    };
    6259
    6360    /**
     
    115112            @return Returns the health type as an enum.
    116113            */
    117             inline pickupHealthType::Value getHealthType(void) const
     114            inline PickupHealthType getHealthType(void) const
    118115                { return this->healthType_; }
    119116            const std::string& getHealthTypeAsString(void) const; //!< Get the health type of this pickup.
     
    127124            @param type The type of this pickup as an enum.
    128125            */
    129             inline void setHealthType(pickupHealthType::Value type)
     126            inline void setHealthType(PickupHealthType type)
    130127                { this->healthType_ = type; }
    131128            void setHealthTypeAsString(const std::string& type); //!< Set the type of the HealthPickup.
     
    139136            float maxHealthSave_; //!< Helper to remember what the actual maxHealth of the Pawn was before we changed it.
    140137            float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well.
    141             pickupHealthType::Value healthType_; //!< The type of the HealthPickup.
     138            PickupHealthType healthType_; //!< The type of the HealthPickup.
    142139
    143140            //! Strings for the health types.
  • code/branches/cpp11_v3/src/modules/pickup/items/MetaPickup.cc

    r11054 r11068  
    7979        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
    8080
    81         this->setDurationType(pickupDurationType::once);
    82         this->metaType_ = pickupMetaType::none;
     81        this->setDurationType(PickupDurationType::once);
     82        this->metaType_ = PickupMetaType::none;
    8383    }
    8484
     
    104104
    105105        // If the MetaPickup transited to used, and the metaType is not none.
    106         if(this->isUsed() && this->metaType_ != pickupMetaType::none)
     106        if(this->isUsed() && this->metaType_ != PickupMetaType::none)
    107107        {
    108108            PickupCarrier* carrier = this->getCarrier();
    109             if(this->getMetaType() != pickupMetaType::none && carrier != nullptr)
     109            if(this->getMetaType() != PickupMetaType::none && carrier != nullptr)
    110110            {
    111111                // If the metaType is destroyCarrier, then the PickupCarrier is destroyed.
    112                 if(this->getMetaType() == pickupMetaType::destroyCarrier)
     112                if(this->getMetaType() == PickupMetaType::destroyCarrier)
    113113                {
    114114                    Pawn* pawn = orxonox_cast<Pawn*>(carrier);
     
    124124
    125125                    // If the metaType is use, then the Pickupable is set to used.
    126                     if(this->getMetaType() == pickupMetaType::use && !pickup->isUsed())
     126                    if(this->getMetaType() == PickupMetaType::use && !pickup->isUsed())
    127127                    {
    128128                        pickup->setUsed(true);
    129129                    }
    130130                    // If the metaType is drop, then the Pickupable is dropped.
    131                     else if(this->getMetaType() == pickupMetaType::drop)
     131                    else if(this->getMetaType() == PickupMetaType::drop)
    132132                    {
    133133                        pickup->drop();
    134134                    }
    135135                    // If the metaType is destroy, then the Pickupable is destroyed.
    136                     else if(this->getMetaType() == pickupMetaType::destroy)
     136                    else if(this->getMetaType() == PickupMetaType::destroy)
    137137                    {
    138138                        pickup->Pickupable::destroy();
     
    154154        switch(this->getMetaType())
    155155        {
    156             case pickupMetaType::none:
     156            case PickupMetaType::none:
    157157                return MetaPickup::metaTypeNone_s;
    158             case pickupMetaType::use:
     158            case PickupMetaType::use:
    159159                return MetaPickup::metaTypeUse_s;
    160             case pickupMetaType::drop:
     160            case PickupMetaType::drop:
    161161                return MetaPickup::metaTypeDrop_s;
    162             case pickupMetaType::destroy:
     162            case PickupMetaType::destroy:
    163163                return MetaPickup::metaTypeDestroy_s;
    164             case pickupMetaType::destroyCarrier:
     164            case PickupMetaType::destroyCarrier:
    165165                return MetaPickup::metaTypeDestroyCarrier_s;
    166166            default:
     
    179179        if(type == MetaPickup::metaTypeNone_s)
    180180        {
    181             this->setMetaType(pickupMetaType::none);
     181            this->setMetaType(PickupMetaType::none);
    182182        }
    183183        else if(type == MetaPickup::metaTypeUse_s)
    184184        {
    185             this->setMetaType(pickupMetaType::use);
     185            this->setMetaType(PickupMetaType::use);
    186186        }
    187187        else if(type == MetaPickup::metaTypeDrop_s)
    188188        {
    189             this->setMetaType(pickupMetaType::drop);
     189            this->setMetaType(PickupMetaType::drop);
    190190        }
    191191        else if(type == MetaPickup::metaTypeDestroy_s)
    192192        {
    193             this->setMetaType(pickupMetaType::destroy);
     193            this->setMetaType(PickupMetaType::destroy);
    194194        }
    195195        else if(type == MetaPickup::metaTypeDestroyCarrier_s)
    196196        {
    197             this->setMetaType(pickupMetaType::destroyCarrier);
     197            this->setMetaType(PickupMetaType::destroyCarrier);
    198198        }
    199199        else
  • code/branches/cpp11_v3/src/modules/pickup/items/MetaPickup.h

    r9667 r11068  
    4848    @ingroup PickupItems
    4949    */
    50     namespace pickupMetaType
     50    enum class PickupMetaType
    5151    {
    52         enum Value
    53         {
    54             none, //!< The @ref orxonox::MetaPickup "MetaPickup" does nothing.
    55             use, //!< The @ref orxonox::MetaPickup "MetaPickup" uses all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    56             drop, //!< The @ref orxonox::MetaPickup "MetaPickup" drops all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    57             destroy, //!< The @ref orxonox::MetaPickup "MetaPickup" destroys all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
    58             destroyCarrier //!< The @ref orxonox::MetaPickup "MetaPickup" destroys the @ref orxonox::PickupCarrier "PickupCarrier".
    59         };
    60     }
     52        none, //!< The @ref orxonox::MetaPickup "MetaPickup" does nothing.
     53        use, //!< The @ref orxonox::MetaPickup "MetaPickup" uses all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     54        drop, //!< The @ref orxonox::MetaPickup "MetaPickup" drops all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     55        destroy, //!< The @ref orxonox::MetaPickup "MetaPickup" destroys all the @ref orxonox::PickupCarrier "PickupCarriers'" @ref orxonox::Pickupable "Pickupables".
     56        destroyCarrier //!< The @ref orxonox::MetaPickup "MetaPickup" destroys the @ref orxonox::PickupCarrier "PickupCarrier".
     57    };
    6158
    6259    /**
     
    10097            @return Returns an enum with the meta type of the MetaPickup.
    10198            */
    102             inline pickupMetaType::Value getMetaType(void) const
     99            inline PickupMetaType getMetaType(void) const
    103100                { return this->metaType_; }
    104101            const std::string& getMetaTypeAsString(void) const; //!< Get the meta type of this MetaPickup.
     
    109106            @param type The meta type as an enum.
    110107            */
    111             inline void setMetaType(pickupMetaType::Value type)
     108            inline void setMetaType(PickupMetaType type)
    112109                { this->metaType_ =  type; }
    113110            void setMetaTypeAsString(const std::string& type); //!< Set the meta type of this MetaPickup.
     
    116113            void initialize(void); //!< Initializes the member variables.
    117114
    118             pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
     115            PickupMetaType metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
    119116
    120117            //! Static strings for the meta types.
  • code/branches/cpp11_v3/src/modules/portals/PortalEndPoint.cc

    r11054 r11068  
    5757
    5858        this->setRadarObjectColour(ColourValue::White);
    59         this->setRadarObjectShape(RadarViewable::Dot);
     59        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    6060        this->setRadarVisibility(true);
    6161        if( GameMode::isMaster() )
  • code/branches/cpp11_v3/src/modules/questsystem/GlobalQuest.cc

    r11054 r11068  
    177177        The player.
    178178    */
    179     QuestStatus::Value GlobalQuest::getStatus(const PlayerInfo* player) const
     179    QuestStatus GlobalQuest::getStatus(const PlayerInfo* player) const
    180180    {
    181181        assert(player);
     
    200200        Returns false if player is nullptr.
    201201    */
    202     bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     202    bool GlobalQuest::setStatus(PlayerInfo* player, const QuestStatus & status)
    203203    {
    204204        assert(player);
  • code/branches/cpp11_v3/src/modules/questsystem/GlobalQuest.h

    r11054 r11068  
    103103            virtual bool isCompletable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be completed.
    104104
    105             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
     105            virtual QuestStatus getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
    106106
    107             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) override; //!< Sets the status for a specific player.
     107            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) override; //!< Sets the status for a specific player.
    108108
    109109        private:
    110110            std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest.
    111             QuestStatus::Value status_; //!< The status of this Quest.
     111            QuestStatus status_; //!< The status of this Quest.
    112112            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
    113113
  • code/branches/cpp11_v3/src/modules/questsystem/LocalQuest.cc

    r11054 r11068  
    168168        Returns the status of the Quest for the input player.
    169169    */
    170     QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const
     170    QuestStatus LocalQuest::getStatus(const PlayerInfo* player) const
    171171    {
    172172        assert(player);
    173173
    174         std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player);
     174        std::map<const PlayerInfo*, QuestStatus>::const_iterator it = this->playerStatus_.find(player);
    175175        if (it != this->playerStatus_.end()) // If there is a player in the map.
    176176            return it->second;
     
    190190        Returns false if player is nullptr.
    191191    */
    192     bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status)
     192    bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus & status)
    193193    {
    194194        assert(player);
  • code/branches/cpp11_v3/src/modules/questsystem/LocalQuest.h

    r11054 r11068  
    9797            virtual bool isCompletable(const PlayerInfo* player) const override; //!< Checks whether the Quest can be completed.
    9898
    99             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
    100             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) override; //!< Sets the status for a specific player.
     99            virtual QuestStatus getStatus(const PlayerInfo* player) const override; //!< Returns the status of the Quest for a specific player.
     100            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) override; //!< Sets the status for a specific player.
    101101
    102102        private:
    103             std::map<const PlayerInfo*, QuestStatus::Value> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
     103            std::map<const PlayerInfo*, QuestStatus> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    104104
    105105    };
  • code/branches/cpp11_v3/src/modules/questsystem/Quest.h

    r11054 r11068  
    5151    @ingroup Questsystem
    5252    */
    53     namespace QuestStatus
     53    enum class QuestStatus
    5454    {
    55         enum Value
    56         {
    57             Inactive, //!< The @ref orxonox::Quest "Quest" is inactive.
    58             Active, //!< The @ref orxonox::Quest "Quest" is active.
    59             Failed, //!< The @ref orxonox::Quest "Quest" has been failed.
    60             Completed //!< The @ref orxonox::Quest "Quest" has been completed.
    61         };
    62     }
     55        Inactive, //!< The @ref orxonox::Quest "Quest" is inactive.
     56        Active, //!< The @ref orxonox::Quest "Quest" is active.
     57        Failed, //!< The @ref orxonox::Quest "Quest" has been failed.
     58        Completed //!< The @ref orxonox::Quest "Quest" has been completed.
     59    };
    6360
    6461    /**
     
    143140                { return this->completeEffects_; }
    144141
    145             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
    146             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
     142            virtual QuestStatus getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
     143            virtual bool setStatus(PlayerInfo* player, const QuestStatus & status) = 0; //!< Changes the status for a specific player.
    147144
    148145        private:
  • code/branches/cpp11_v3/src/modules/questsystem/QuestDescription.cc

    r9667 r11068  
    119119        }
    120120
    121         NotificationListener::sendNotification(message, QuestDescription::SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     121        NotificationListener::sendNotification(message, QuestDescription::SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    122122        return true;
    123123    }
  • code/branches/cpp11_v3/src/modules/questsystem/QuestEffectBeacon.h

    r11054 r11068  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestEffectBeaconStatus
     52    enum class QuestEffectBeaconStatus
    5353    {
    54         enum Value
    55         {
    56             Inactive, //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is inactive.
    57             Active //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is active.
    58         };
    59     }
     54        Inactive, //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is inactive.
     55        Active //!< The @ref orxonox::QuestEffectBeacon "QuestEffectBeacon" is active.
     56    };
    6057
    6158    /**
     
    125122            std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
    126123            int times_; //!< Number of times the beacon can be exectued.
    127             QuestEffectBeaconStatus::Value status_; //!< The status of the QuestEffectBeacon, Can be eighter active or inactive.
     124            QuestEffectBeaconStatus status_; //!< The status of the QuestEffectBeacon, Can be eighter active or inactive.
    128125
    129126            bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
  • code/branches/cpp11_v3/src/modules/questsystem/QuestHint.cc

    r11054 r11068  
    9292
    9393        // Find the player.
    94         std::map<const PlayerInfo*, QuestHintStatus::Value>::const_iterator it = this->playerStatus_.find(player);
     94        std::map<const PlayerInfo*, QuestHintStatus>::const_iterator it = this->playerStatus_.find(player);
    9595        if (it != this->playerStatus_.end()) // If the player is in the map.
    96             return it->second;
     96            return (it->second == QuestHintStatus::Active);
    9797
    98         return QuestStatus::Inactive;
     98        return false;
    9999    }
    100100
  • code/branches/cpp11_v3/src/modules/questsystem/QuestHint.h

    r11054 r11068  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestHintStatus
     52    enum class QuestHintStatus
    5353    {
    54         enum Value
    55         {
    56             Inactive, //!< The @ref orxonox::QuestHint "QuestHint" is inactive.
    57             Active //!< The @ref orxonox::QuestHint "QuestHint" is active.
    58         };
    59     }
     54        Inactive, //!< The @ref orxonox::QuestHint "QuestHint" is inactive.
     55        Active //!< The @ref orxonox::QuestHint "QuestHint" is active.
     56    };
    6057
    6158    /**
     
    10198        private:
    10299            Quest* quest_; //!< The Quest the QuestHint belongs to.
    103             std::map<const PlayerInfo*, QuestHintStatus::Value> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
     100            std::map<const PlayerInfo*, QuestHintStatus> playerStatus_; //!< List of the states for each player, with the Player-pointer as key.
    104101
    105102    }; // tolua_export
  • code/branches/cpp11_v3/src/modules/questsystem/QuestListener.h

    r11054 r11068  
    5050    @ingroup Questsystem
    5151    */
    52     namespace QuestListenerMode
     52    enum class QuestListenerMode
    5353    {
    54         enum Value
    55         {
    56             All, //!< Listens to all events.
    57             Start, //!< Only listens to events pertaining the starting of @ref orxonox::Quest "Quests".
    58             Fail, //!< Only listens to events pertaining the failing of @ref orxonox::Quest "Quests".
    59             Complete //!< Only listens to events pertaining the completing of @ref orxonox::Quest "Quests".
    60         };
    61     }
     54        All, //!< Listens to all events.
     55        Start, //!< Only listens to events pertaining the starting of @ref orxonox::Quest "Quests".
     56        Fail, //!< Only listens to events pertaining the failing of @ref orxonox::Quest "Quests".
     57        Complete //!< Only listens to events pertaining the completing of @ref orxonox::Quest "Quests".
     58    };
    6259
    6360    /**
     
    103100
    104101        private:
    105             QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
     102            QuestListenerMode mode_; //!< The mode of the QuestListener.
    106103            Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
    107104
  • code/branches/cpp11_v3/src/modules/towerdefense/TowerDefense.cc

    r11054 r11068  
    355355                fields_[i][j]->create(fields.at(pos), fields.at(pos+1));
    356356                pos += 2;
    357                 if (fields_[i][j]->getType() == START)
     357                if (fields_[i][j]->getType() == TowerDefenseFieldType::START)
    358358                {
    359359                    startCoord.Set(i,j);
     
    379379        TDCoordinate* nextCoord = new TDCoordinate(0,0);
    380380
    381         if (thisField->getType() != STREET && thisField->getType() != START)
     381        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
    382382        {
    383383            return nullptr;
  • code/branches/cpp11_v3/src/modules/towerdefense/TowerDefenseEnemy.cc

    r11058 r11068  
    2727        RegisterObject(TowerDefenseEnemy);
    2828
    29         this->setCollisionType(WorldEntity::Dynamic);
     29        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    3030        //needed to keep track of the PlayerStats coded in TowerDefense.h
    3131        this->td = orxonox_cast<TowerDefense*>(this->getGametype());
  • code/branches/cpp11_v3/src/modules/towerdefense/TowerDefenseField.cc

    r11054 r11068  
    5050
    5151        tower_ = nullptr;
    52         type_ = FREE;
     52        type_ = TowerDefenseFieldType::FREE;
    5353        center_ = nullptr;
    5454        upgrade_ = 0;
     
    186186        modelGround_->setMeshSource("TD_F1.mesh");
    187187        tower_ = nullptr;
    188         type_ = FREE;
     188        type_ = TowerDefenseFieldType::FREE;
    189189        setUpgrade(0);
    190190        setAngle(orientation);
     
    195195        modelGround_->setMeshSource("TD_S5.mesh");
    196196        tower_ = nullptr;
    197         type_ = START;
     197        type_ = TowerDefenseFieldType::START;
    198198        setUpgrade(0);
    199199        setAngle(orientation);   
     
    205205        modelGround_->setMeshSource("TD_S4.mesh");
    206206        tower_ = nullptr;
    207         type_ = END;
     207        type_ = TowerDefenseFieldType::END;
    208208        setUpgrade(0);
    209209        setAngle(orientation);
     
    214214        modelGround_->setMeshSource("TD_S1.mesh");
    215215        tower_ = nullptr;
    216         type_ = STREET;
     216        type_ = TowerDefenseFieldType::STREET;
    217217        setUpgrade(0);
    218218        setAngle(orientation);
     
    223223        modelGround_->setMeshSource("TD_S2.mesh");
    224224        tower_ = nullptr;
    225         type_ = STREET;
     225        type_ = TowerDefenseFieldType::STREET;
    226226        setUpgrade(0);
    227227        setAngle(orientation);
     
    232232        modelGround_->setMeshSource("TD_S3.mesh");
    233233        tower_ = nullptr;
    234         type_ = STREET;
     234        type_ = TowerDefenseFieldType::STREET;
    235235        setUpgrade(0);
    236236        setAngle(orientation);
     
    242242        modelObject_->setMeshSource("TD_O1.mesh");
    243243        tower_ = nullptr;
    244         type_ = OBSTACLE;
     244        type_ = TowerDefenseFieldType::OBSTACLE;
    245245        setUpgrade(0);
    246246        setAngle(orientation);
     
    254254            tower_ = new TowerDefenseTower(center_->getContext());
    255255            attach(tower_);
    256             type_ = TOWER;
     256            type_ = TowerDefenseFieldType::TOWER;
    257257            setUpgrade(upgrade);
    258258            if (upgrade_ > 0 && modelObject_ != nullptr)
  • code/branches/cpp11_v3/src/modules/towerdefense/TowerDefenseField.h

    r11054 r11068  
    4646namespace orxonox
    4747{
    48     enum TowerDefenseFieldType
     48    enum class TowerDefenseFieldType
    4949    {
    5050        FREE,
     
    6464            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6565            const bool isFree() const
    66                 { return type_==FREE; }
     66                { return type_==TowerDefenseFieldType::FREE; }
    6767            virtual void create(char object, char param);
    6868            virtual void setCenterpoint(TowerDefenseCenterpoint* center);
  • code/branches/cpp11_v3/src/modules/towerdefense/TowerDefenseTower.cc

    r11054 r11068  
    2626        RegisterObject(TowerDefenseTower);
    2727        game_ =nullptr;
    28         this->setCollisionType(WorldEntity::None);
     28        this->setCollisionType(WorldEntity::CollisionType::None);
    2929        upgrade = 1;
    3030
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBomb.cc

    r10622 r11068  
    2828                this->timeToLife_= LIFETIME;
    2929                this->setCollisionResponse(false);
    30                 this->setCollisionType(WorldEntity::Dynamic);
     30                this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    3131                this->enableCollisionCallback();
    3232
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/GravityBombField.cc

    r11054 r11068  
    4141        //Make the Field visible on Radar and minimap.
    4242        this->setRadarObjectColour(ColourValue(1.0, 0.0, 0.2,1)); // Red
    43         this->setRadarObjectShape(RadarViewable::Dot);
     43        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    4444        this->setRadarObjectScale(1.0f);
    4545       
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/IceGunProjectile.cc

    r11052 r11068  
    120120            Vector3 offset = this->getWorldPosition() - otherObject->getWorldPosition();
    121121            freezer->setPosition(Vector3(0,0,0));
    122             freezer->translate(offset, WorldEntity::World);
     122            freezer->translate(offset, WorldEntity::TransformSpace::World);
    123123            // Start the freezing effect.
    124124            freezer->startFreezing();
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/LightningGunProjectile.cc

    r10622 r11068  
    4848        this->textureIndex_ = 1;
    4949        this->setMass(2);
    50         this->setCollisionType(Dynamic);
     50        this->setCollisionType(CollisionType::Dynamic);
    5151        this->maxTextureIndex_ = 8;
    5252        this->textureTimer_.setTimer(0.01f, true, createExecutor(createFunctor(&LightningGunProjectile::changeTexture, this)));
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Projectile.cc

    r11054 r11068  
    5757            this->enableCollisionCallback();
    5858            this->setCollisionResponse(false);
    59             this->setCollisionType(Dynamic);
     59            this->setCollisionType(CollisionType::Dynamic);
    6060
    6161            // Create a sphere collision shape and attach it to the projectile.
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/Rocket.cc

    r11054 r11068  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/RocketOld.cc

    r11054 r11068  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->setVelocity(0,0,-100);
    7474
     
    9292            this->enableCollisionCallback();
    9393            this->setCollisionResponse(false);
    94             this->setCollisionType(Kinematic);
     94            this->setCollisionType(CollisionType::Kinematic);
    9595
    9696            // Add collision shape
     
    128128
    129129        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
    130         this->setRadarObjectShape(RadarViewable::Triangle);
     130        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    131131        this->setRadarObjectScale(0.5f);
    132132    }
  • code/branches/cpp11_v3/src/modules/weapons/projectiles/SimpleRocket.cc

    r11052 r11068  
    7070        if (GameMode::isMaster())
    7171        {
    72             this->setCollisionType(WorldEntity::Kinematic);
     72            this->setCollisionType(WorldEntity::CollisionType::Kinematic);
    7373            this->fuel_ = true;
    7474
     
    8787            this->enableCollisionCallback();
    8888            this->setCollisionResponse(false);
    89             this->setCollisionType(Kinematic);
     89            this->setCollisionType(CollisionType::Kinematic);
    9090
    9191            // Add collision shape.
     
    101101
    102102        this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
    103         this->setRadarObjectShape(RadarViewable::Triangle);
     103        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    104104        this->setRadarObjectScale(0.5f);
    105105    }
  • code/branches/cpp11_v3/src/orxonox/Main.h

    r5693 r11068  
    3333#include "OrxonoxPrereqs.h"
    3434
     35#include <string>
     36
    3537namespace orxonox
    3638{
  • code/branches/cpp11_v3/src/orxonox/Radar.cc

    r11054 r11068  
    5555        // TODO: make this mapping configurable. Maybe there's a possibility with self configured
    5656        //       configValues..
    57         this->objectTypes_["Asteroid"] = RadarViewable::Dot;
    58         this->objectTypes_["SpaceShip"] = RadarViewable::Square;
    59         this->objectTypes_["AsdfQwerty"] = RadarViewable::Triangle;
     57        this->objectTypes_["Asteroid"] = RadarViewable::Shape::Dot;
     58        this->objectTypes_["SpaceShip"] = RadarViewable::Shape::Square;
     59        this->objectTypes_["AsdfQwerty"] = RadarViewable::Shape::Triangle;
    6060
    6161        /*WorldEntity* object;
     
    113113        std::map<std::string, RadarViewable::Shape>::iterator it = this->objectTypes_.find(name);
    114114        if (it == this->objectTypes_.end())
    115             return this->objectTypes_[name] = RadarViewable::Square; // default, configure!!
     115            return this->objectTypes_[name] = RadarViewable::Shape::Square; // default, configure!!
    116116        else
    117117            return this->objectTypes_[name];
  • code/branches/cpp11_v3/src/orxonox/gametypes/Gametype.h

    r11054 r11068  
    4545namespace orxonox
    4646{
    47     namespace PlayerState
    48     {
    49         enum Value
    50         {
    51             Uninitialized,
    52             Joined,
    53             Alive,
    54             Dead
    55         };
    56     }
     47    enum class PlayerState
     48    {
     49        Uninitialized,
     50        Joined,
     51        Alive,
     52        Dead
     53    };
    5754
    5855    struct Player
    5956    {
    6057        PlayerInfo* info_;
    61         PlayerState::Value state_;
     58        PlayerState state_;
    6259        int frags_;
    6360        int killed_;
  • code/branches/cpp11_v3/src/orxonox/graphics/Light.cc

    r11054 r11068  
    4444
    4545    // Be sure we don't do bad conversions
    46     static_assert((int)Ogre::Light::LT_POINT       == (int)Light::Point,       "check enum");
    47     static_assert((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Directional, "check enum");
    48     static_assert((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Spotlight,   "check enum");
     46    static_assert((int)Ogre::Light::LT_POINT       == (int)Light::Type::Point,       "check enum");
     47    static_assert((int)Ogre::Light::LT_DIRECTIONAL == (int)Light::Type::Directional, "check enum");
     48    static_assert((int)Ogre::Light::LT_SPOTLIGHT   == (int)Light::Type::Spotlight,   "check enum");
    4949
    5050    Light::Light(Context* context) : StaticEntity(context)
     
    5555        this->diffuse_ = ColourValue::White;
    5656        this->specular_ = ColourValue::White;
    57         this->type_ = Light::Point;
     57        this->type_ = Type::Point;
    5858        this->attenuation_ = Vector4(100000, 1, 0, 0);
    5959        this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
     
    105105    void Light::registerVariables()
    106106    {
    107         registerVariable((int&)this->type_,     VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));
     107        registerVariable(this->type_,           VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateType));
    108108        registerVariable(this->diffuse_,        VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateDiffuseColour));
    109109        registerVariable(this->specular_,       VariableDirection::ToClient, new NetworkCallback<Light>(this, &Light::updateSpecularColour));
     
    126126    void Light::updateAttenuation()
    127127    {
    128         if (this->light_ && this->type_ != Light::Directional)
     128        if (this->light_ && this->type_ != Type::Directional)
    129129            this->light_->setAttenuation(this->attenuation_.x, this->attenuation_.y, this->attenuation_.z, this->attenuation_.w);
    130130    }
     
    132132    void Light::updateSpotlightRange()
    133133    {
    134         if (this->light_ && this->type_ == Light::Spotlight)
     134        if (this->light_ && this->type_ == Type::Spotlight)
    135135            this->light_->setSpotlightRange(Degree(this->spotlightRange_.x), Degree(this->spotlightRange_.y), this->spotlightRange_.z);
    136136    }
     
    139139    {
    140140        if (type == "point")
    141             this->setType(Light::Point);
     141            this->setType(Type::Point);
    142142        else if (type == "directional")
    143             this->setType(Light::Directional);
     143            this->setType(Type::Directional);
    144144        else if (type == "spotlight")
    145             this->setType(Light::Spotlight);
     145            this->setType(Type::Spotlight);
    146146        else
    147             this->setType(Light::Point);
     147            this->setType(Type::Point);
    148148    }
    149149
     
    152152        switch (this->type_)
    153153        {
    154             case Light::Directional:
     154            case Type::Directional:
    155155                return "directional";
    156             case Light::Spotlight:
     156            case Type::Spotlight:
    157157                return "spotlight";
    158             case Light::Point:
     158            case Type::Point:
    159159            default:
    160160                return "point";
     
    168168            this->light_->setType(static_cast<Ogre::Light::LightTypes>(this->type_));
    169169
    170             if (this->type_ != Light::Directional)
     170            if (this->type_ != Type::Directional)
    171171                this->updateAttenuation();
    172             if (this->type_ == Light::Spotlight)
     172            if (this->type_ == Type::Spotlight)
    173173                this->updateSpotlightRange();
    174174        }
  • code/branches/cpp11_v3/src/orxonox/graphics/Light.h

    r11054 r11068  
    4242    {
    4343        public:
    44             enum LightTypes // Copy from the Ogre enum
     44            enum class Type // Copy from the Ogre enum
    4545            {
    4646                /// Point light sources give off light equally in all directions, so require only position not direction
     
    6363                { return this->light_; }
    6464
    65             inline void setType(Light::LightTypes type)
     65            inline void setType(Light::Type type)
    6666                { this->type_ = type; this->updateType(); }
    67             inline Light::LightTypes getType() const
     67            inline Light::Type getType() const
    6868                { return this->type_; }
    6969
     
    144144
    145145            Ogre::Light* light_;
    146             LightTypes type_;
     146            Light::Type type_;
    147147            ColourValue diffuse_;
    148148            ColourValue specular_;
  • code/branches/cpp11_v3/src/orxonox/infos/GametypeInfo.cc

    r11054 r11068  
    291291        if(GameMode::isMaster())
    292292        {
    293             NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     293            NotificationListener::sendNotification("Press [Fire] to respawn", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    294294            // Remove the player from the list of players that have spawned, since it currently is not.
    295295            this->spawnedPlayers_.erase(player);
     
    346346                // Display "Press [Fire] to start the match" if the game has not yet ended.
    347347                if(!this->hasEnded())
    348                     NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     348                    NotificationListener::sendNotification("Press [Fire] to start the match", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    349349                // Else display "Game has ended".
    350350                else
    351                     NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, notificationMessageType::info, notificationSendMode::network, player->getClientID());
     351                    NotificationListener::sendNotification("Game has ended", GametypeInfo::NOTIFICATION_SENDER, NotificationMessageType::info, NotificationSendMode::network, player->getClientID());
    352352            }
    353353        }
  • code/branches/cpp11_v3/src/orxonox/interfaces/NotificationListener.cc

    r11054 r11068  
    7474        The type of the notification, can be either 'info' or 'important'.
    7575    */
    76     /*static*/ void NotificationListener::sendNetworkHelper(const std::string& message, const std::string& sender, notificationSendMode::Value sendMode, unsigned int clientId, bool isCommand, notificationMessageType::Value messageType)
     76    /*static*/ void NotificationListener::sendNetworkHelper(const std::string& message, const std::string& sender, NotificationSendMode sendMode, unsigned int clientId, bool isCommand, NotificationMessageType messageType)
    7777    {
    7878        // If we're in standalone mode or we're already no the right client we create and send the notification/command.
    79         if(GameMode::isStandalone() || sendMode == notificationSendMode::local || (sendMode ==  notificationSendMode::network && Host::getPlayerID() == clientId))
     79        if(GameMode::isStandalone() || sendMode == NotificationSendMode::local || (sendMode ==  NotificationSendMode::network && Host::getPlayerID() == clientId))
    8080        {
    8181            sendHelper(message, sender, isCommand, messageType);
    8282        }
    8383        // If we're on the server (and the server is not the intended recipient of the notification/command) we send it over the network.
    84         else if(GameMode::isServer() && sendMode == notificationSendMode::network && Host::getPlayerID() != clientId)
     84        else if(GameMode::isServer() && sendMode == NotificationSendMode::network && Host::getPlayerID() != clientId)
    8585        {
    86             callStaticNetworkFunction(&NotificationListener::sendHelper, clientId, message, sender, isCommand, (unsigned int)messageType);
     86            callStaticNetworkFunction(&NotificationListener::sendHelper, clientId, message, sender, isCommand, messageType);
    8787        }
    88         else if(GameMode::isServer() && sendMode == notificationSendMode::broadcast)
     88        else if(GameMode::isServer() && sendMode == NotificationSendMode::broadcast)
    8989        {
    9090            // TODO: Works as intended?
    91             callStaticNetworkFunction(&NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, (unsigned int)messageType);
     91            callStaticNetworkFunction(&NotificationListener::sendHelper, NETWORK_PEER_ID_BROADCAST, message, sender, isCommand, messageType);
    9292        }
    9393    }
     
    105105        The type of the notification.
    106106    */
    107     /*static*/ void NotificationListener::sendHelper(const std::string& message, const std::string& sender, bool isCommand, unsigned int messageType)
     107    /*static*/ void NotificationListener::sendHelper(const std::string& message, const std::string& sender, bool isCommand, NotificationMessageType type)
    108108    {
    109109        // Iterate through all NotificationListeners and notify them by calling the method they overloaded.
     
    112112            // If the notification is a message.
    113113            if(!isCommand)
    114                 listener->registerNotification(message, sender, notificationMessageType::Value(messageType));
     114                listener->registerNotification(message, sender, type);
    115115
    116116            // If the notification is a command.
    117117            if(isCommand)
    118118            {
    119                 notificationCommand::Value command = str2Command(message);
    120                 if(command != notificationCommand::none)
     119                NotificationCommand command = str2Command(message);
     120                if(command != NotificationCommand::none)
    121121                    listener->executeCommand(command, sender);
    122122            }
     
    130130        The string to be converted.
    131131    @return
    132         Returns the corresponding enum, notificationCommand::none if the command doesn't exist.
     132        Returns the corresponding enum, NotificationCommand::none if the command doesn't exist.
    133133    */
    134     /*static*/ notificationCommand::Value NotificationListener::str2Command(const std::string& string)
     134    /*static*/ NotificationCommand NotificationListener::str2Command(const std::string& string)
    135135    {
    136         notificationCommand::Value command = notificationCommand::none;
     136        NotificationCommand command = NotificationCommand::none;
    137137
    138138        if(string == NotificationListener::COMMAND_CLEAR)
    139             command = notificationCommand::clear;
     139            command = NotificationCommand::clear;
    140140
    141141        return command;
     
    150150        Returns the corresponding string.
    151151    */
    152     /*static*/ const std::string& NotificationListener::command2Str(notificationCommand::Value command)
     152    /*static*/ const std::string& NotificationListener::command2Str(NotificationCommand command)
    153153    {
    154154        switch(command)
    155155        {
    156             case notificationCommand::clear:
     156            case NotificationCommand::clear:
    157157                return NotificationListener::COMMAND_CLEAR;
    158158            default:
  • code/branches/cpp11_v3/src/orxonox/interfaces/NotificationListener.h

    r9667 r11068  
    4949{
    5050    // TODO: Document.
    51     namespace notificationMessageType
    52     {
    53         enum Value {
    54             info,
    55             important
    56         };
    57     }
     51    enum class NotificationMessageType {
     52        info,
     53        important
     54    };
    5855   
    59     namespace notificationSendMode
    60     {
    61         enum Value {
    62             local,
    63             network,
    64             broadcast
    65         };
    66     }
     56    enum class NotificationSendMode {
     57        local,
     58        network,
     59        broadcast
     60    };
    6761   
    68     namespace notificationCommand
    69     {
    70         enum Value {
    71             none,
    72             clear
    73         };
    74     }
     62    enum class NotificationCommand {
     63        none,
     64        clear
     65    };
    7566
    7667    // TODO: Update doc.
     
    10192            @param sender The sender that sent the notification. Default is 'none'.
    10293            @param messageType The type of the message, can be either 'info' or 'important'. Default is 'info'.
    103             @param sendMode The mode in which the notification is sent, can be 'local' to send the notification to the client where this function is executed, 'network' if the notification is to be sent to the client with the specified clientID, or 'broadcast' if the notification should be sent to all hosts. Default is notificationSendMode::local.
     94            @param sendMode The mode in which the notification is sent, can be 'local' to send the notification to the client where this function is executed, 'network' if the notification is to be sent to the client with the specified clientID, or 'broadcast' if the notification should be sent to all hosts. Default is NotificationSendMode::local.
    10495            @param clientId The id of the client the notification should be sent to. Default is 0.
    10596            */
    106             static void sendNotification(const std::string& message, const std::string& sender = NotificationListener::NONE, notificationMessageType::Value messageType = notificationMessageType::info, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0)
     97            static void sendNotification(const std::string& message, const std::string& sender = NotificationListener::NONE, NotificationMessageType messageType = NotificationMessageType::info, NotificationSendMode sendMode = NotificationSendMode::local, unsigned int clientId = 0)
    10798                { NotificationListener::sendNetworkHelper(message, sender, sendMode, clientId, false, messageType); }
    10899            /**
     
    110101            @param command The command that should be sent (and later executed).
    111102            @param sender The sender that sent the notification. Default is 'none'.
    112             @param sendMode The mode in which the command is sent, can be 'local' to send the command to the client where this function is executed, 'network' if the command is to be sent to the client with the specified clientID, or 'broadcast' if the command should be sent to all hosts. Default is notificationSendMode::local.
     103            @param sendMode The mode in which the command is sent, can be 'local' to send the command to the client where this function is executed, 'network' if the command is to be sent to the client with the specified clientID, or 'broadcast' if the command should be sent to all hosts. Default is NotificationSendMode::local.
    113104            @param clientId The id of the client the command should be sent to. Default is 0.
    114105            */
    115             static void sendCommand(const std::string& command, const std::string& sender = NotificationListener::NONE, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0)
     106            static void sendCommand(const std::string& command, const std::string& sender = NotificationListener::NONE, NotificationSendMode sendMode = NotificationSendMode::local, unsigned int clientId = 0)
    116107                { NotificationListener::sendNetworkHelper(command, sender, sendMode, clientId, true); }
    117108
    118             static void sendHelper(const std::string& message, const std::string& sender, bool isCommand = false, unsigned int messageMode = 0); // Helper method to register a notification/execute a command with all NotificationListeners after it has been sent over the network.
     109            static void sendHelper(const std::string& message, const std::string& sender, bool isCommand, NotificationMessageType type); // Helper method to register a notification/execute a command with all NotificationListeners after it has been sent over the network.
    119110
    120111            //TODO: Make protected?
     
    128119            @return Returns true if the notification was successfully registered, false if not.
    129120            */
    130             virtual bool registerNotification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     121            virtual bool registerNotification(const std::string& message, const std::string& sender, NotificationMessageType type)
    131122                { return false; }
    132123            /**
     
    137128            @return Returns true if the command was successfully executed, false if not.
    138129            */
    139             virtual bool executeCommand(notificationCommand::Value command, const std::string& sender) { return false; }
     130            virtual bool executeCommand(NotificationCommand command, const std::string& sender) { return false; }
    140131
    141132        public:
     
    149140           
    150141        protected:
    151             static void sendNetworkHelper(const std::string& message, const std::string& sender, notificationSendMode::Value sendMode, unsigned int clientId, bool isCommand = false, notificationMessageType::Value messageType = notificationMessageType::info); // Helper method to send both notifications and commands over the network.
     142            static void sendNetworkHelper(const std::string& message, const std::string& sender, NotificationSendMode sendMode, unsigned int clientId, bool isCommand = false, NotificationMessageType messageType = NotificationMessageType::info); // Helper method to send both notifications and commands over the network.
    152143
    153             static notificationCommand::Value str2Command(const std::string& string); // Helper method. Converts a string into the enum for a command.
    154             static const std::string& command2Str(notificationCommand::Value command); // Helper method. Converts a command enum into its corresponding string.
     144            static NotificationCommand str2Command(const std::string& string); // Helper method. Converts a string into the enum for a command.
     145            static const std::string& command2Str(NotificationCommand command); // Helper method. Converts a command enum into its corresponding string.
    155146    };
    156147}
  • code/branches/cpp11_v3/src/orxonox/interfaces/RadarViewable.cc

    r10624 r11068  
    4949        , wePtr_(wePtr)
    5050        , radarObjectCamouflage_(0.0f)
    51         , radarObjectShape_(Dot)
     51        , radarObjectShape_(Shape::Dot)
    5252        , radarObjectDescription_("staticObject")
    5353        , scale_(1.0f)
  • code/branches/cpp11_v3/src/orxonox/interfaces/RadarViewable.h

    r11054 r11068  
    4949    {
    5050    public:
    51         enum Shape
     51        enum class Shape
    5252        {
    5353            Square,
  • code/branches/cpp11_v3/src/orxonox/items/MultiStateEngine.cc

    r11054 r11068  
    124124                this->state_ = 0;
    125125                if (this->getShip()->isBoosting() && forward)
    126                     this->state_ = Boost;
     126                    this->state_ = EngineState::Boost;
    127127                else if (forward && !this->state_) // this->state_ == Boost
    128                     this->state_ = Normal;
     128                    this->state_ = EngineState::Normal;
    129129                else if (direction.z > 0.0 && velocity.z < 0.0)
    130                     this->state_ = Brake;
     130                    this->state_ = EngineState::Brake;
    131131                else
    132                     this->state_ = Idle;
    133 
    134                 if (this->state_ == Idle && this->getSpeedAdd() > 0)
    135                     this->state_ = Normal;
     132                    this->state_ = EngineState::Idle;
     133
     134                if (this->state_ == EngineState::Idle && this->getSpeedAdd() > 0)
     135                    this->state_ = EngineState::Normal;
    136136            }
    137137
     
    141141
    142142                float pitch = velocity.length();
    143                 if (this->state_ & Normal)
     143                if (this->state_ & EngineState::Normal)
    144144                    defEngineSndNormal_->setPitch(clamp(pitch/MAX_VELOCITY_NORMAL + 1, 0.5f, 2.0f));
    145                 if (this->state_ & Boost)
     145                if (this->state_ & EngineState::Boost)
    146146                    defEngineSndBoost_->setPitch(clamp(pitch/MAX_VELOCITY_BOOST + 1, 0.5f, 2.0f));
    147147
    148                 if (changes & Idle)
    149                 {
    150                     lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & Idle);
     148                if (changes & EngineState::Idle)
     149                {
     150                    lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & EngineState::Idle);
    151151                    lua_setglobal(this->lua_->getInternalLuaState(), "idle");
    152152                }
    153                 if (changes & Normal)
    154                 {
    155                     lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & Normal);
     153                if (changes & EngineState::Normal)
     154                {
     155                    lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & EngineState::Normal);
    156156                    lua_setglobal(this->lua_->getInternalLuaState(), "normal");
    157                     if (this->state_ & Normal)
     157                    if (this->state_ & EngineState::Normal)
    158158                        defEngineSndNormal_->play();
    159159                    else
    160160                        defEngineSndNormal_->stop();
    161161                }
    162                 if (changes & Brake)
    163                 {
    164                     lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & Brake);
     162                if (changes & EngineState::Brake)
     163                {
     164                    lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & EngineState::Brake);
    165165                    lua_setglobal(this->lua_->getInternalLuaState(), "brake");
    166166                }
    167                 if (changes & Boost)
    168                 {
    169                     lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & Boost);
     167                if (changes & EngineState::Boost)
     168                {
     169                    lua_pushboolean(this->lua_->getInternalLuaState(), this->state_ & EngineState::Boost);
    170170                    lua_setglobal(this->lua_->getInternalLuaState(), "boost");
    171                     if (this->state_ & Boost)
     171                    if (this->state_ & EngineState::Boost)
    172172                        defEngineSndBoost_->play();
    173173                    else
  • code/branches/cpp11_v3/src/orxonox/items/MultiStateEngine.h

    r11054 r11068  
    4141    {
    4242        public:
    43             enum EngineState
     43            struct EngineState
    4444            {
    45                 Idle    = 1,
    46                 Normal  = 2,
    47                 Brake   = 4,
    48                 Boost   = 8
     45                static constexpr int Idle    = 1;
     46                static constexpr int Normal  = 2;
     47                static constexpr int Brake   = 4;
     48                static constexpr int Boost   = 8;
    4949            };
    5050
  • code/branches/cpp11_v3/src/orxonox/items/PartDestructionEvent.cc

    r10262 r11068  
    9898        {
    9999            switch (this->targetParam_) {
    100             case shieldhealth:
     100            case TargetParam::shieldhealth:
    101101                this->parent_->getParent()->setShieldHealth(operate(this->parent_->getParent()->getShieldHealth()));
    102102                break;
    103             case boostpower:
     103            case TargetParam::boostpower:
    104104                this->parent_->getParent()->setInitialBoostPower(operate(this->parent_->getParent()->getInitialBoostPower()));
    105105                break;
    106             case boostpowerrate:
     106            case TargetParam::boostpowerrate:
    107107                this->parent_->getParent()->setBoostPowerRate(operate(this->parent_->getParent()->getBoostPowerRate()));
    108108                break;
    109             case rotationthrust:
     109            case TargetParam::rotationthrust:
    110110                this->parent_->getParent()->setRotationThrust(operate(this->parent_->getParent()->getRotationThrust()));
    111111                break;
     
    120120        {
    121121            switch (this->targetParam_) {
    122             case null:
     122            case TargetParam::null:
    123123                this->parent_->getParent()->getEngineByName(targetName_)->destroy();
    124124                break;
    125             case boostfactor:
     125            case TargetParam::boostfactor:
    126126                this->parent_->getParent()->getEngineByName(targetName_)->setBoostFactor(operate(this->parent_->getParent()->getEngineByName(targetName_)->getBoostFactor()));
    127127                break;
    128             case speedfront:
     128            case TargetParam::speedfront:
    129129                this->parent_->getParent()->getEngineByName(targetName_)->setMaxSpeedFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getMaxSpeedFront()));
    130130                break;
    131             case accelerationfront:
     131            case TargetParam::accelerationfront:
    132132                this->parent_->getParent()->getEngineByName(targetName_)->setAccelerationFront(operate(this->parent_->getParent()->getEngineByName(targetName_)->getAccelerationFront()));
    133133                break;
     
    142142        {
    143143            switch (this->targetParam_) {
    144             case null:
     144            case TargetParam::null:
    145145                if (!this->parent_->getParent()->getShipPartByName(targetName_))
    146146                    return;
     
    214214            if (param == "NULL")
    215215            {
    216                 this->targetParam_ = null;
     216                this->targetParam_ = TargetParam::null;
    217217                return;
    218218            }
    219219            if (param == "boostfactor")
    220220            {
    221                 this->targetParam_ = boostfactor;
     221                this->targetParam_ = TargetParam::boostfactor;
    222222                return;
    223223            }
    224224            if (param == "speedfront")
    225225            {
    226                 this->targetParam_ = speedfront;
     226                this->targetParam_ = TargetParam::speedfront;
    227227                return;
    228228            }
    229229            if (param == "accelerationfront")
    230230            {
    231                 this->targetParam_ = accelerationfront;
     231                this->targetParam_ = TargetParam::accelerationfront;
    232232                return;
    233233            }
     
    244244            if (param == "shieldhealth")
    245245            {
    246                 this->targetParam_ = shieldhealth;
     246                this->targetParam_ = TargetParam::shieldhealth;
    247247                return;
    248248            }
    249249            if (param == "boostpower")
    250250            {
    251                 this->targetParam_ = boostpower;
     251                this->targetParam_ = TargetParam::boostpower;
    252252                return;
    253253            }
    254254            if (param == "boostpowerrate")
    255255            {
    256                 this->targetParam_ = boostpowerrate;
     256                this->targetParam_ = TargetParam::boostpowerrate;
    257257                return;
    258258            }
    259259            if (param == "rotationthrust")
    260260            {
    261                 this->targetParam_ = rotationthrust;
     261                this->targetParam_ = TargetParam::rotationthrust;
    262262                return;
    263263            }
     
    271271            if (param == "NULL")
    272272            {
    273                 this->targetParam_ = null;
     273                this->targetParam_ = TargetParam::null;
    274274                return;
    275275            }
  • code/branches/cpp11_v3/src/orxonox/items/PartDestructionEvent.h

    r11054 r11068  
    8282                    List of all allowed parameters.
    8383                */
    84             enum TargetParam
     84            enum class TargetParam
    8585            {
    8686                shieldhealth,
  • code/branches/cpp11_v3/src/orxonox/overlays/InGameConsole.cc

    r11054 r11068  
    292292
    293293        for (int i = LINES - 1; i > max; --i)
    294             this->print("", Shell::DebugOutput, i, true);
     294            this->print("", Shell::LineType::DebugOutput, i, true);
    295295
    296296        for (int i = max; i >= 1; --i)
     
    318318    {
    319319        if (LINES > 0)
    320             this->print(this->shell_->getInput(), Shell::Input, 0);
     320            this->print(this->shell_->getInput(), Shell::LineType::Input, 0);
    321321
    322322        if (this->shell_->getInput().empty())
     
    342342    void InGameConsole::executed()
    343343    {
    344         this->shell_->addOutput(this->shell_->getInput(), Shell::Command);
     344        this->shell_->addOutput(this->shell_->getInput(), Shell::LineType::Command);
    345345    }
    346346
     
    562562        switch (type)
    563563        {
    564             case Shell::Message:
    565             case Shell::DebugOutput:     colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
    566 
    567             case Shell::UserError:       colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;
    568             case Shell::UserWarning:     colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;
    569             case Shell::UserStatus:      colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;
    570             case Shell::UserInfo:        colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;
    571 
    572             case Shell::InternalError:   colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;
    573             case Shell::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;
    574             case Shell::InternalStatus:  colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;
    575             case Shell::InternalInfo:    colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;
    576 
    577             case Shell::Verbose:         colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;
    578             case Shell::VerboseMore:     colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;
    579             case Shell::VerboseUltra:    colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;
    580 
    581             case Shell::Command:         colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;
    582             case Shell::Hint:            colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;
    583             case Shell::Input:           colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
    584 
    585             default:                     colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;
     564            case Shell::LineType::Message:
     565            case Shell::LineType::DebugOutput:     colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
     566
     567            case Shell::LineType::UserError:       colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;
     568            case Shell::LineType::UserWarning:     colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;
     569            case Shell::LineType::UserStatus:      colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;
     570            case Shell::LineType::UserInfo:        colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;
     571
     572            case Shell::LineType::InternalError:   colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;
     573            case Shell::LineType::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;
     574            case Shell::LineType::InternalStatus:  colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;
     575            case Shell::LineType::InternalInfo:    colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;
     576
     577            case Shell::LineType::Verbose:         colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;
     578            case Shell::LineType::VerboseMore:     colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;
     579            case Shell::LineType::VerboseUltra:    colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;
     580
     581            case Shell::LineType::Command:         colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;
     582            case Shell::LineType::Hint:            colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;
     583            case Shell::LineType::Input:           colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
     584
     585            default:                               colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;
    586586        }
    587587
  • code/branches/cpp11_v3/src/orxonox/overlays/OrxonoxOverlay.cc

    r11054 r11068  
    9494        this->angle_ = Degree(0.0);
    9595        this->bCorrectAspect_ = false;
    96         this->rotState_ = Horizontal;
     96        this->rotState_ = RotationState::Horizontal;
    9797        this->angleChanged(); // updates all other values as well
    9898
     
    259259            {
    260260                tempAspect = 1.0f / this->windowAspectRatio_;
    261                 rotState_ = Vertical;
     261                rotState_ = RotationState::Vertical;
    262262            }
    263263            else if (angle > 179 || angle < 1)
    264264            {
    265265                tempAspect = this->windowAspectRatio_;
    266                 rotState_ = Horizontal;
     266                rotState_ = RotationState::Horizontal;
    267267            }
    268268            else
    269269            {
    270270                tempAspect = 1.0f;
    271                 rotState_ = Inbetween;
     271                rotState_ = RotationState::Inbetween;
    272272            }
    273273
  • code/branches/cpp11_v3/src/orxonox/overlays/OrxonoxOverlay.h

    r11061 r11068  
    7979            and in between is everything else.
    8080        */
    81         enum RotationState
     81        enum class RotationState
    8282        {
    8383            Horizontal,
  • code/branches/cpp11_v3/src/orxonox/sound/BaseSound.cc

    r11054 r11068  
    4949        , volume_(0.7)
    5050        , bLooping_(false)
    51         , state_(Stopped)
     51        , state_(State::Stopped)
    5252        , pitch_ (1.0)
    5353    {
     
    6363    BaseSound::~BaseSound()
    6464    {
    65         if (this->state_ != Stopped)
     65        if (this->state_ != State::Stopped)
    6666            this->stop();
    6767        // Release buffer
     
    8383    void BaseSound::doPlay()
    8484    {
    85         this->state_ = Playing;
     85        this->state_ = State::Playing;
    8686        if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr)
    8787        {
     
    102102    bool BaseSound::doStop()
    103103    {
    104         this->state_ = Stopped;
     104        this->state_ = State::Stopped;
    105105        if (alIsSource(this->audioSource_))
    106106        {
     
    123123        if (this->isStopped())
    124124            return;
    125         this->state_ = Paused;
     125        this->state_ = State::Paused;
    126126        if (alIsSource(this->audioSource_))
    127127            alSourcePause(this->audioSource_);
     
    256256        else // No source acquired so far, but might be set to playing or paused
    257257        {
    258             State state = static_cast<State>(this->state_); // save
     258            State state = this->state_; // save
    259259            if (this->isPlaying() || this->isPaused())
    260260                doPlay();
    261             if (state == Paused)
    262             {
    263                 this->state_ = Paused;
     261            if (state == State::Paused)
     262            {
     263                this->state_ = State::Paused;
    264264                doPause();
    265265            }
     
    271271        switch (this->state_)
    272272        {
    273             case Playing:
     273            case State::Playing:
    274274                this->play();
    275275                break;
    276             case Paused:
     276            case State::Paused:
    277277                this->pause();
    278278                break;
    279             case Stopped:
     279            case State::Stopped:
    280280            default:
    281281                this->stop();
  • code/branches/cpp11_v3/src/orxonox/sound/BaseSound.h

    r11054 r11068  
    5454        virtual void pause() { this->doPause(); }
    5555
    56         bool isPlaying() const { return this->state_ == Playing; }
    57         bool isPaused()  const { return this->state_ == Paused; }
    58         bool isStopped() const { return this->state_ == Stopped; }
     56        bool isPlaying() const { return this->state_ == State::Playing; }
     57        bool isPaused()  const { return this->state_ == State::Paused; }
     58        bool isStopped() const { return this->state_ == State::Stopped; }
    5959
    6060        virtual void setSource(const std::string& source);
     
    7676
    7777    protected:
    78         enum State
     78        enum class State
    7979        {
    8080            Stopped,
     
    111111        float           volume_;
    112112        bool            bLooping_;
    113         uint8_t         state_;       // This Variable is actually of type State
     113        State           state_;       // This Variable is actually of type State
    114114        float           pitch_;
    115115
  • code/branches/cpp11_v3/src/orxonox/sound/WorldSound.cc

    r9939 r11068  
    5858        registerVariable(bLooping_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::loopingChanged));
    5959        registerVariable(pitch_,    ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::pitchChanged));
    60         registerVariable((uint8_t&)(BaseSound::state_), ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
     60        registerVariable(BaseSound::state_, ObjectDirection::ToClient, new NetworkCallback<WorldSound>(this, &WorldSound::stateChanged));
    6161    }
    6262
  • code/branches/cpp11_v3/src/orxonox/worldentities/Drone.cc

    r11054 r11068  
    4949        this->localAngularAcceleration_.setValue(0, 0, 0);
    5050        this->setRadarVisibility(false);
    51         this->setCollisionType(WorldEntity::Dynamic);
     51        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    5252
    5353        myController_ = new DroneController(this->getContext()); //!< Creates a new controller and passes our this pointer to it as creator.
  • code/branches/cpp11_v3/src/orxonox/worldentities/MobileEntity.cc

    r9667 r11068  
    189189    bool MobileEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    190190    {
    191         if (type == WorldEntity::Static)
     191        if (type == WorldEntity::CollisionType::Static)
    192192        {
    193193            orxout(internal_warning) << "Cannot tell a MobileEntity to have static collision type! Ignoring." << endl;
  • code/branches/cpp11_v3/src/orxonox/worldentities/StaticEntity.cc

    r9667 r11068  
    9595    bool StaticEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    9696    {
    97         if (type == WorldEntity::Kinematic || type == WorldEntity::Dynamic)
     97        if (type == WorldEntity::CollisionType::Kinematic || type == WorldEntity::CollisionType::Dynamic)
    9898        {
    9999            orxout(internal_warning) << "Cannot tell a StaticEntity to have kinematic or dynamic collision type! Ignoring." << endl;
  • code/branches/cpp11_v3/src/orxonox/worldentities/WorldEntity.cc

    r11054 r11068  
    5656
    5757    // Be sure we don't do bad conversions
    58     static_assert((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::Local,  "check enum");
    59     static_assert((int)Ogre::Node::TS_PARENT == (int)WorldEntity::Parent, "check enum");
    60     static_assert((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::World,  "check enum");
     58    static_assert((int)Ogre::Node::TS_LOCAL  == (int)WorldEntity::TransformSpace::Local,  "check enum");
     59    static_assert((int)Ogre::Node::TS_PARENT == (int)WorldEntity::TransformSpace::Parent, "check enum");
     60    static_assert((int)Ogre::Node::TS_WORLD  == (int)WorldEntity::TransformSpace::World,  "check enum");
    6161
    6262    RegisterAbstractClass(WorldEntity).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>();
     
    9595        this->collisionShape_ = new WorldEntityCollisionShape(this->getContext());
    9696        this->collisionShape_->setWorldEntityOwner(this);
    97         this->collisionType_             = None;
    98         this->collisionTypeSynchronised_ = None;
     97        this->collisionType_             = CollisionType::None;
     98        this->collisionTypeSynchronised_ = CollisionType::None;
    9999        this->mass_                 = 1.0f;
    100100        this->childrenMass_         = 0;
     
    207207        registerVariable(this->bCollisionResponseActive_,
    208208                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionResponseActivityChanged));
    209         registerVariable((int&)this->collisionTypeSynchronised_,
     209        registerVariable(this->collisionTypeSynchronised_,
    210210                                                VariableDirection::ToClient, new NetworkCallback<WorldEntity>(this, &WorldEntity::collisionTypeChanged));
    211211        registerVariable(this->bPhysicsActiveSynchronised_,
     
    322322    void WorldEntity::collisionTypeChanged()
    323323    {
    324         if (this->collisionTypeSynchronised_ != Dynamic &&
    325             this->collisionTypeSynchronised_ != Kinematic &&
    326             this->collisionTypeSynchronised_ != Static &&
    327             this->collisionTypeSynchronised_ != None)
     324        if (this->collisionTypeSynchronised_ != CollisionType::Dynamic &&
     325            this->collisionTypeSynchronised_ != CollisionType::Kinematic &&
     326            this->collisionTypeSynchronised_ != CollisionType::Static &&
     327            this->collisionTypeSynchronised_ != CollisionType::None)
    328328        {
    329329            orxout(internal_error) << "Error when collsion Type was received over network. Unknown enum value:" << this->collisionTypeSynchronised_ << endl;
     
    681681        switch (relativeTo)
    682682        {
    683         case WorldEntity::Local:
     683        case TransformSpace::Local:
    684684            // position is relative to parent so transform downwards
    685685            this->setPosition(this->getPosition() + this->getOrientation() * distance);
    686686            break;
    687         case WorldEntity::Parent:
     687        case TransformSpace::Parent:
    688688            this->setPosition(this->getPosition() + distance);
    689689            break;
    690         case WorldEntity::World:
     690        case TransformSpace::World:
    691691            // position is relative to parent so transform upwards
    692692            if (this->node_->getParent())
     
    711711        switch(relativeTo)
    712712        {
    713         case WorldEntity::Local:
     713        case TransformSpace::Local:
    714714            this->setOrientation(this->getOrientation() * rotation);
    715715            break;
    716         case WorldEntity::Parent:
     716        case TransformSpace::Parent:
    717717            // Rotations are normally relative to local axes, transform up
    718718            this->setOrientation(rotation * this->getOrientation());
    719719            break;
    720         case WorldEntity::World:
     720        case TransformSpace::World:
    721721            // Rotations are normally relative to local axes, transform up
    722722            this->setOrientation(this->getOrientation() * this->getWorldOrientation().Inverse()
     
    741741        switch (relativeTo)
    742742        {
    743         case WorldEntity::Local:
     743        case TransformSpace::Local:
    744744            origin = Vector3::ZERO;
    745745            break;
    746         case WorldEntity::Parent:
     746        case TransformSpace::Parent:
    747747            origin = this->getPosition();
    748748            break;
    749         case WorldEntity::World:
     749        case TransformSpace::World:
    750750            origin = this->getWorldPosition();
    751751            break;
     
    831831
    832832        // Check whether we have to create or destroy.
    833         if (type != None && this->collisionType_ == None)
     833        if (type != CollisionType::None && this->collisionType_ == CollisionType::None)
    834834        {
    835835/*
     
    849849            this->physicalBody_->setActivationState(DISABLE_DEACTIVATION);
    850850        }
    851         else if (type == None && this->collisionType_ != None)
     851        else if (type == CollisionType::None && this->collisionType_ != CollisionType::None)
    852852        {
    853853            // Destroy rigid body
     
    856856            delete this->physicalBody_;
    857857            this->physicalBody_ = nullptr;
    858             this->collisionType_ = None;
    859             this->collisionTypeSynchronised_ = None;
     858            this->collisionType_ = CollisionType::None;
     859            this->collisionTypeSynchronised_ = CollisionType::None;
    860860            return;
    861861        }
     
    864864        switch (type)
    865865        {
    866         case Dynamic:
     866        case CollisionType::Dynamic:
    867867            this->physicalBody_->setCollisionFlags(this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT & !btCollisionObject::CF_KINEMATIC_OBJECT);
    868868            break;
    869         case Kinematic:
     869        case CollisionType::Kinematic:
    870870            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_STATIC_OBJECT) | btCollisionObject::CF_KINEMATIC_OBJECT);
    871871            break;
    872         case Static:
     872        case CollisionType::Static:
    873873            this->physicalBody_->setCollisionFlags((this->physicalBody_->getCollisionFlags() & !btCollisionObject::CF_KINEMATIC_OBJECT) | btCollisionObject::CF_STATIC_OBJECT);
    874874            break;
    875         case None:
     875        case CollisionType::None:
    876876            assert(false); // Doesn't happen
    877877            return;
     
    895895        CollisionType type;
    896896        if (typeStrLower == "dynamic")
    897             type = Dynamic;
     897            type = CollisionType::Dynamic;
    898898        else if (typeStrLower == "static")
    899             type = Static;
     899            type = CollisionType::Static;
    900900        else if (typeStrLower == "kinematic")
    901             type = Kinematic;
     901            type = CollisionType::Kinematic;
    902902        else if (typeStrLower == "none")
    903             type = None;
     903            type = CollisionType::None;
    904904        else
    905905            ThrowException(ParseError, std::string("Attempting to set an unknown collision type: '") + typeStr + "'.");
     
    912912        switch (this->getCollisionType())
    913913        {
    914             case Dynamic:
     914            case CollisionType::Dynamic:
    915915                return "dynamic";
    916             case Kinematic:
     916            case CollisionType::Kinematic:
    917917                return "kinematic";
    918             case Static:
     918            case CollisionType::Static:
    919919                return "static";
    920             case None:
     920            case CollisionType::None:
    921921                return "none";
    922922            default:
  • code/branches/cpp11_v3/src/orxonox/worldentities/WorldEntity.h

    r11054 r11068  
    8282                Enumeration denoting the spaces which a transform can be relative to.
    8383            */
    84             enum TransformSpace
     84            enum class TransformSpace
    8585            {
    8686                //! Transform is relative to the local space
     
    117117            const Vector3& getWorldPosition() const;
    118118
    119             void translate(const Vector3& distance, TransformSpace relativeTo = WorldEntity::Parent);
    120             inline void translate(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Parent)
     119            void translate(const Vector3& distance, TransformSpace relativeTo = TransformSpace::Parent);
     120            inline void translate(float x, float y, float z, TransformSpace relativeTo = TransformSpace::Parent)
    121121                { this->translate(Vector3(x, y, z), relativeTo); }
    122122
     
    134134            const Quaternion& getWorldOrientation() const;
    135135
    136             void rotate(const Quaternion& rotation, TransformSpace relativeTo = WorldEntity::Local);
    137             inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
     136            void rotate(const Quaternion& rotation, TransformSpace relativeTo = TransformSpace::Local);
     137            inline void rotate(const Vector3& axis, const Degree& angle, TransformSpace relativeTo = TransformSpace::Local)
    138138                { this->rotate(Quaternion(angle, axis), relativeTo); }
    139139
    140             inline void yaw(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
     140            inline void yaw(const Degree& angle, TransformSpace relativeTo = TransformSpace::Local)
    141141                { this->rotate(Quaternion(angle, Vector3::UNIT_Y), relativeTo); }
    142             inline void pitch(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
     142            inline void pitch(const Degree& angle, TransformSpace relativeTo = TransformSpace::Local)
    143143                { this->rotate(Quaternion(angle, Vector3::UNIT_X), relativeTo); }
    144             inline void roll(const Degree& angle, TransformSpace relativeTo = WorldEntity::Local)
     144            inline void roll(const Degree& angle, TransformSpace relativeTo = TransformSpace::Local)
    145145                { this->rotate(Quaternion(angle, Vector3::UNIT_Z), relativeTo); }
    146146
    147             void lookAt(const Vector3& target, TransformSpace relativeTo = WorldEntity::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    148             void setDirection(const Vector3& direction, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
    149             inline void setDirection(float x, float y, float z, TransformSpace relativeTo = WorldEntity::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
     147            void lookAt(const Vector3& target, TransformSpace relativeTo = TransformSpace::Parent, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     148            void setDirection(const Vector3& direction, TransformSpace relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z);
     149            inline void setDirection(float x, float y, float z, TransformSpace relativeTo = TransformSpace::Local, const Vector3& localDirectionVector = Vector3::NEGATIVE_UNIT_Z)
    150150                { this->setDirection(Vector3(x, y, z), relativeTo, localDirectionVector); }
    151151
     
    257257                None:      The object has no physics at all.
    258258            */
    259             enum CollisionType
     259            enum class CollisionType
    260260            {
    261261                Dynamic,
     
    266266
    267267            //! Tells whether the object has any connection to the Bullet physics engine. If hasPhysics() is false, the object may still have a velocity.
    268             bool hasPhysics()       const { return getCollisionType() != None     ; }
     268            bool hasPhysics()       const { return getCollisionType() != CollisionType::None     ; }
    269269            //! @see CollisionType
    270             bool isStatic()         const { return getCollisionType() == Static   ; }
     270            bool isStatic()         const { return getCollisionType() == CollisionType::Static   ; }
    271271            //! @see CollisionType
    272             bool isKinematic()      const { return getCollisionType() == Kinematic; }
     272            bool isKinematic()      const { return getCollisionType() == CollisionType::Kinematic; }
    273273            //! @see CollisionType
    274             bool isDynamic()        const { return getCollisionType() == Dynamic  ; }
     274            bool isDynamic()        const { return getCollisionType() == CollisionType::Dynamic  ; }
    275275            //! Tells whether physics has been activated (you can temporarily deactivate it)
    276276            bool isPhysicsActive()  const { return this->bPhysicsActive_; }
  • code/branches/cpp11_v3/src/orxonox/worldentities/pawns/FpsPlayer.cc

    r11054 r11068  
    7979        // FpsPlayer is always a physical object per default
    8080        // Be aware of this call: The collision type legality check will not reach derived classes!
    81         this->setCollisionType(WorldEntity::Dynamic);
     81        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    8282        // Get notification about collisions
    8383        this->enableCollisionCallback();
     
    130130    bool FpsPlayer::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    131131    {
    132         if (type != WorldEntity::Dynamic)
     132        if (type != WorldEntity::CollisionType::Dynamic)
    133133        {
    134134            orxout(internal_warning) << "Cannot tell a FpsPlayer not to be dynamic! Ignoring." << endl;
     
    168168            if (!this->isInMouseLook())
    169169            {
    170                 this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity::Parent);
     170                this->yaw(Radian(this->yaw_ * this->getMouseLookSpeed()), WorldEntity::TransformSpace::Parent);
    171171
    172172                Radian pitch = this->cameraPositionRootNode_->getOrientation().getPitch();
  • code/branches/cpp11_v3/src/orxonox/worldentities/pawns/Pawn.cc

    r11062 r11068  
    9797
    9898        this->setRadarObjectColour(ColourValue::Red);
    99         this->setRadarObjectShape(RadarViewable::Dot);
     99        this->setRadarObjectShape(RadarViewable::Shape::Dot);
    100100
    101101        this->registerVariables();
  • code/branches/cpp11_v3/src/orxonox/worldentities/pawns/SpaceShip.cc

    r11054 r11068  
    8080        // SpaceShip is always a physical object per default
    8181        // Be aware of this call: The collision type legality check will not reach derived classes!
    82         this->setCollisionType(WorldEntity::Dynamic);
     82        this->setCollisionType(WorldEntity::CollisionType::Dynamic);
    8383        // Get notification about collisions
    8484        this->enableCollisionCallback();
     
    145145    bool SpaceShip::isCollisionTypeLegal(WorldEntity::CollisionType type) const
    146146    {
    147         if (type != WorldEntity::Dynamic)
     147        if (type != WorldEntity::CollisionType::Dynamic)
    148148        {
    149149            orxout(internal_warning) << "Cannot tell a SpaceShip not to be dynamic! Ignoring." << endl;
  • code/branches/cpp11_v3/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc

    r11054 r11068  
    5151        }
    5252
    53         this->setRadarObjectShape(RadarViewable::Triangle);
     53        this->setRadarObjectShape(RadarViewable::Shape::Triangle);
    5454    }
    5555
  • code/branches/cpp11_v3/src/orxonox/worldentities/pawns/TeamBaseMatchBase.h

    r9667 r11068  
    3636namespace orxonox
    3737{
    38     namespace BaseState
     38    enum class BaseState
    3939    {
    40         enum Value
    41         {
    42             Uncontrolled,
    43             ControlTeam1,
    44             ControlTeam2,
    45         };
    46     }
     40        Uncontrolled,
     41        ControlTeam1,
     42        ControlTeam2,
     43    };
    4744
    4845
     
    5855
    5956            // Set the state of a base to whatever the argument of the function is
    60             void setState(BaseState::Value state)
     57            void setState(BaseState state)
    6158            {
    6259                this->state_ = state;
     
    6663
    6764            // Get the state of a base as a return value
    68             BaseState::Value getState() const
     65            BaseState getState() const
    6966            {
    7067                return this->state_;
     
    7572            void changeTeamColour();
    7673
    77             BaseState::Value state_;
     74            BaseState state_;
    7875    };
    7976}
  • code/branches/cpp11_v3/test/util/MultiTypeTest.cc

    r10197 r11068  
    697697        EXPECT_TRUE(mt.null());
    698698    }
     699
     700    ///////////////////////////////
     701    // Strongly typed enum class //
     702    ///////////////////////////////
     703    enum class EnumWithChar : unsigned char
     704    {
     705        ValueA = 'A',
     706        ValueB = 'B',
     707        ValueC = 'C',
     708    };
     709    enum class EnumWithInt
     710    {
     711        Value1 = 50,
     712        Value2 = 0,
     713        Value3,
     714    };
     715
     716    TEST(MultiType, Enum_Constructor)
     717    {
     718        // Constructor:
     719        {
     720            MultiType mt = EnumWithChar::ValueA;
     721
     722            EXPECT_TRUE(mt.isType<EnumWithChar>());
     723            EXPECT_EQ(EnumWithChar::ValueA, mt.get<EnumWithChar>());
     724        }
     725        {
     726            MultiType mt = MultiType(EnumWithInt::Value1);
     727
     728            EXPECT_TRUE(mt.isType<EnumWithInt>());
     729            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
     730        }
     731    }
     732
     733    TEST(MultiType, Enum_Assignment)
     734    {
     735        // operator=:
     736        MultiType mt;
     737        mt = EnumWithChar::ValueB;
     738
     739        EXPECT_TRUE(mt.isType<EnumWithChar>());
     740        EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
     741    }
     742
     743    TEST(MultiType, Enum_Set)
     744    {
     745        // set(value):
     746        {
     747            MultiType mt;
     748            mt.set(EnumWithInt::Value2); // assign enum to an empty MultiType
     749
     750            EXPECT_TRUE(mt.isType<EnumWithInt>());
     751            EXPECT_EQ(EnumWithInt::Value2, mt.get<EnumWithInt>());
     752        }
     753        {
     754            MultiType mt = "string";
     755            mt.set(EnumWithChar::ValueC); // assign enum to a MultiType with type std::string
     756
     757            EXPECT_TRUE(mt.isType<std::string>());
     758            EXPECT_EQ("C", mt.get<std::string>());
     759        }
     760        {
     761            MultiType mt = EnumWithChar::ValueA;
     762            mt.set(EnumWithChar::ValueB); // assign enum to a MultiType with type std::string
     763
     764            EXPECT_TRUE(mt.isType<EnumWithChar>());
     765            EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
     766        }
     767        {
     768            MultiType mt = EnumWithInt::Value3;
     769            mt.set("50"); // assign enum to a MultiType with type std::string
     770
     771            EXPECT_TRUE(mt.isType<EnumWithInt>());
     772            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
     773        }
     774    }
     775
     776    TEST(MultiType, Enum_Force)
     777    {
     778        // force(value):
     779        {
     780            MultiType mt = "string";
     781            EXPECT_TRUE(mt.isType<std::string>());
     782            EXPECT_EQ("string", mt.get<std::string>());
     783
     784            mt.force<EnumWithChar>("C");
     785
     786            EXPECT_TRUE(mt.isType<EnumWithChar>());
     787            EXPECT_EQ(EnumWithChar::ValueC, mt.get<EnumWithChar>());
     788        }
     789        {
     790            MultiType mt = EnumWithChar::ValueA;
     791            EXPECT_TRUE(mt.isType<EnumWithChar>());
     792            EXPECT_EQ(EnumWithChar::ValueA, mt.get<EnumWithChar>());
     793
     794            mt.force<std::string>(EnumWithChar::ValueB);
     795
     796            EXPECT_TRUE(mt.isType<std::string>());
     797            EXPECT_EQ("B", mt.get<std::string>());
     798        }
     799    }
     800
     801    TEST(MultiType, Enum_Convert)
     802    {
     803        // convert():
     804        {
     805            MultiType mt = "C";
     806            mt.convert<EnumWithChar>();
     807
     808            EXPECT_TRUE(mt.isType<EnumWithChar>());
     809            EXPECT_EQ(EnumWithChar::ValueC, mt.get<EnumWithChar>());
     810        }
     811        {
     812            MultiType mt = EnumWithChar::ValueA;
     813            mt.convert<std::string>();
     814
     815            EXPECT_TRUE(mt.isType<std::string>());
     816            EXPECT_EQ("A", mt.get<std::string>());
     817        }
     818    }
     819
     820    TEST(MultiType, Enum_Reset)
     821    {
     822        // reset():
     823        {
     824            MultiType mt = EnumWithChar::ValueA;
     825            mt.reset<EnumWithChar>();
     826
     827            EXPECT_TRUE(mt.isType<EnumWithChar>());
     828            EXPECT_TRUE(mt.isType<unsigned char>());
     829            EXPECT_EQ('\0', mt.get<unsigned char>());
     830        }
     831        {
     832            MultiType mt = "string";
     833            mt.reset<EnumWithInt>();
     834
     835            EXPECT_TRUE(mt.isType<EnumWithInt>());
     836            EXPECT_TRUE(mt.isType<int>());
     837            EXPECT_EQ(0, mt.get<int>());
     838        }
     839    }
     840
     841    TEST(MultiType, Enum_IsType)
     842    {
     843        // isType():
     844        {
     845            MultiType mt = EnumWithChar::ValueB;
     846            EXPECT_TRUE(mt.isType<EnumWithChar>());
     847            EXPECT_TRUE(mt.isType<unsigned char>());
     848            EXPECT_FALSE(mt.isType<char>());
     849            EXPECT_FALSE(mt.isType<int>());
     850            EXPECT_FALSE(mt.isType<bool>());
     851            EXPECT_FALSE(mt.isType<std::string>());
     852        }
     853        {
     854            MultiType mt = EnumWithInt::Value3;
     855            EXPECT_TRUE(mt.isType<EnumWithInt>());
     856            EXPECT_TRUE(mt.isType<int>());
     857            EXPECT_FALSE(mt.isType<unsigned char>());
     858            EXPECT_FALSE(mt.isType<char>());
     859            EXPECT_FALSE(mt.isType<bool>());
     860            EXPECT_FALSE(mt.isType<std::string>());
     861        }
     862    }
     863
     864    TEST(MultiType, Enum_ConversionOperator)
     865    {
     866        // conversion operator:
     867        {
     868            MultiType mt = EnumWithChar::ValueA;
     869            EnumWithChar value = mt;
     870            EXPECT_EQ(EnumWithChar::ValueA, value);
     871        }
     872        {
     873            MultiType mt = 'B';
     874            EnumWithChar value = mt;
     875            EXPECT_EQ(EnumWithChar::ValueB, value);
     876        }
     877        {
     878            MultiType mt = EnumWithInt::Value1;
     879            std::string value = mt;
     880            EXPECT_EQ("50", value);
     881        }
     882    }
     883
     884    TEST(MultiType, Enum_GetValue)
     885    {
     886        // getValue():
     887        {
     888            MultiType mt = EnumWithChar::ValueA;
     889            EnumWithChar value;
     890            mt.getValue(&value);
     891            EXPECT_EQ(EnumWithChar::ValueA, value);
     892        }
     893        {
     894            MultiType mt = 'B';
     895            EnumWithChar value;
     896            mt.getValue(&value);
     897            EXPECT_EQ(EnumWithChar::ValueB, value);
     898        }
     899        {
     900            MultiType mt = EnumWithInt::Value1;
     901            std::string value;
     902            mt.getValue(&value);
     903            EXPECT_EQ("50", value);
     904        }
     905    }
     906
     907    TEST(MultiType, Enum_Get)
     908    {
     909        // get():
     910        {
     911            MultiType mt = EnumWithChar::ValueB;
     912            EXPECT_EQ(EnumWithChar::ValueB, mt.get<EnumWithChar>());
     913
     914            EXPECT_EQ('B', mt.get<unsigned char>());
     915            EXPECT_EQ("B", mt.get<std::string>());
     916            EXPECT_EQ(66, mt.get<int>());
     917            EXPECT_TRUE(mt.get<bool>());
     918        }
     919        {
     920            MultiType mt = EnumWithInt::Value1;
     921            EXPECT_EQ(EnumWithInt::Value1, mt.get<EnumWithInt>());
     922
     923            EXPECT_EQ('2', mt.get<unsigned char>());
     924            EXPECT_EQ("50", mt.get<std::string>());
     925            EXPECT_EQ(50, mt.get<int>());
     926            EXPECT_TRUE(mt.get<bool>());
     927        }
     928        {
     929            MultiType mt = EnumWithInt::Value2;
     930            EXPECT_EQ(EnumWithInt::Value2, mt.get<EnumWithInt>());
     931
     932            EXPECT_EQ('\0', mt.get<unsigned char>());
     933            EXPECT_EQ("0", mt.get<std::string>());
     934            EXPECT_EQ(0, mt.get<int>());
     935            EXPECT_FALSE(mt.get<bool>());
     936        }
     937    }
    699938}
Note: See TracChangeset for help on using the changeset viewer.