[Orxonox-commit 6350] r11007 - in code/branches/cpp11_v2/src: libraries/core libraries/core/command orxonox/overlays

landauf at orxonox.net landauf at orxonox.net
Thu Dec 31 00:43:34 CET 2015


Author: landauf
Date: 2015-12-31 00:43:34 +0100 (Thu, 31 Dec 2015)
New Revision: 11007

Modified:
   code/branches/cpp11_v2/src/libraries/core/XMLPort.h
   code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h
   code/branches/cpp11_v2/src/libraries/core/command/Executor.h
   code/branches/cpp11_v2/src/libraries/core/command/Functor.h
   code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc
   code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc
   code/branches/cpp11_v2/src/libraries/core/command/Shell.cc
   code/branches/cpp11_v2/src/libraries/core/command/Shell.h
   code/branches/cpp11_v2/src/orxonox/overlays/InGameConsole.cc
Log:
made some enums in core library strongly typed. for other enums in core (especially in the input library) this isn't possible because enums are often used like flags (converted to int and compared with binary operators).

Modified: code/branches/cpp11_v2/src/libraries/core/XMLPort.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/XMLPort.h	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/XMLPort.h	2015-12-30 23:43:34 UTC (rev 11007)
@@ -323,16 +323,16 @@
     class _CoreExport XMLPortParamContainer
     {
     public:
-        enum ParseResult
+        enum class ParseResult
         {
-            PR_not_started,
-            PR_finished,
-            PR_waiting_for_default_values
+            not_started,
+            finished,
+            waiting_for_default_values
         };
 
         public:
             XMLPortParamContainer()
-                { this->parseResult_ = PR_not_started; }
+                { this->parseResult_ = ParseResult::not_started; }
             virtual ~XMLPortParamContainer() = default;
 
             inline const std::string& getName() const
@@ -414,14 +414,14 @@
                             int error;
                             this->loadexecutor_->parse(object, attributeValue, &error, ",");
                             if (!error || (mode  == XMLPort::ExpandObject))
-                                this->parseResult_ = PR_finished;
+                                this->parseResult_ = ParseResult::finished;
                             else
-                                this->parseResult_ = PR_waiting_for_default_values;
+                                this->parseResult_ = ParseResult::waiting_for_default_values;
                         }
                         else if (mode == XMLPort::ExpandObject)
-                            this->parseResult_ = PR_finished;
+                            this->parseResult_ = ParseResult::finished;
                         else
-                            this->parseResult_ = PR_waiting_for_default_values;
+                            this->parseResult_ = ParseResult::waiting_for_default_values;
                     }
                     catch (ticpp::Exception& ex)
                     {
@@ -448,7 +448,7 @@
 
             XMLPortParamContainer& portIfWaitingForDefaultValues(const ParseResult& result, const ParseParams& params)
             {
-                if (result == PR_waiting_for_default_values)
+                if (result == ParseResult::waiting_for_default_values)
                     return this->port(this->owner_, params);
                 else
                     return (*this);

Modified: code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/ConsoleCommand.h	2015-12-30 23:43:34 UTC (rev 11007)
@@ -59,23 +59,20 @@
         inline std::string string__uint_uint_bool(unsigned int, unsigned int, bool) { return ""; }
     }
 
-    namespace AccessLevel
+    /**
+        @brief Possible access levels: A command can only be executed if the program is in the state which is requested by the access level.
+    */
+    enum class AccessLevel
     {
-        /**
-            @brief Possible access levels: A command can only be executed if the program is in the state which is requested by the access level.
-        */
-        enum Enum
-        {
-            All,
-            Standalone,
-            Master,
-            Server,
-            Client,
-            Online,
-            Offline,
-            None
-        };
-    }
+        All,
+        Standalone,
+        Master,
+        Server,
+        Client,
+        Online,
+        Offline,
+        None
+    };
 
     /**
         @brief The ConsoleCommand class stores all information about a console command which can be executed by CommandExecutor.
@@ -248,7 +245,7 @@
                         { if (this->command_) { this->command_->defaultValue(index, arg); } return *this; }
 
                     /// Changes the access level of the command.
-                    inline ConsoleCommandManipulator& accessLevel(AccessLevel::Enum level)
+                    inline ConsoleCommandManipulator& accessLevel(AccessLevel level)
                         { if (this->command_) { this->command_->accessLevel(level); } return *this; }
 
                     /// Changes the argument completer for the given parameter.
@@ -331,10 +328,10 @@
             ConsoleCommand& defaultValue(unsigned int index, const MultiType& arg);
 
             /// Changes the access level of the command.
-            inline ConsoleCommand& accessLevel(AccessLevel::Enum level)
+            inline ConsoleCommand& accessLevel(AccessLevel level)
                 { this->accessLevel_ = level; return *this; }
             /// Returns the access level of the command.
-            inline AccessLevel::Enum getAccessLevel() const
+            inline AccessLevel getAccessLevel() const
                 { return this->accessLevel_; }
 
             ConsoleCommand& argumentCompleter(unsigned int index, ArgumentCompleter* completer);
@@ -393,7 +390,7 @@
 
             bool bActive_;                                                  ///< True if the command should be active (it can still be inactive, for example if the function is missing)
             bool bHidden_;                                                  ///< True if the command is hidden (it is still executable, but not visible in the list of available commands)
-            AccessLevel::Enum accessLevel_;                                 ///< The access level (the state of the game in which you can access the command)
+            AccessLevel accessLevel_;                                       ///< The access level (the state of the game in which you can access the command)
             std::string baseName_;                                          ///< The name that was first assigned to the command
             std::vector<CommandName> names_;                                ///< All names and aliases of this command
             FunctorPtr baseFunctor_;                                        ///< The functor that defines the header of the command-function

Modified: code/branches/cpp11_v2/src/libraries/core/command/Executor.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Executor.h	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/Executor.h	2015-12-30 23:43:34 UTC (rev 11007)
@@ -146,7 +146,7 @@
             inline bool hasReturnvalue() const
                 { return this->functor_->hasReturnvalue(); }
             /// Returns the type of the wrapped function (static or member).
-            inline Functor::Type::Enum getType() const
+            inline Functor::Type getType() const
                 { return this->functor_->getType(); }
             /// Returns the name of the type of a parameter with given index (the first parameter has index 0).
             inline std::string getTypenameParam(unsigned int param) const

Modified: code/branches/cpp11_v2/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-30 23:43:34 UTC (rev 11007)
@@ -175,14 +175,11 @@
     class _CoreExport Functor
     {
         public:
-            struct Type
+            /// Defines the type of a function (static or member)
+            enum class Type
             {
-                /// Defines the type of a function (static or member)
-                enum Enum
-                {
-                    Static,
-                    Member
-                };
+                Static,
+                Member
             };
 
         public:
@@ -195,7 +192,7 @@
             virtual FunctorPtr clone() = 0;
 
             /// Returns the type of the function: static or member.
-            virtual Type::Enum getType() const = 0;
+            virtual Type getType() const = 0;
             /// Returns the number of parameters of the function.
             virtual unsigned int getParamCount() const = 0;
             /// Returns true if the function has a return-value.
@@ -261,7 +258,7 @@
             }
 
             // see Functor::getType()
-            virtual inline Functor::Type::Enum getType() const override
+            virtual inline Functor::Type getType() const override
                 { return Functor::Type::Member; }
 
             /// Assigns an object-pointer to the functor which is used to execute a member-function.
@@ -338,7 +335,7 @@
             }
 
             // see Functor::getType()
-            virtual inline Functor::Type::Enum getType() const override
+            virtual inline Functor::Type getType() const override
                 { return Functor::Type::Static; }
 
             // see Functor::setRawObjectPointer()

Modified: code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/IOConsolePOSIX.cc	2015-12-30 23:43:34 UTC (rev 11007)
@@ -45,15 +45,12 @@
 {
     IOConsole* IOConsole::singletonPtr_s = nullptr;
 
-    namespace EscapeMode
+    enum class EscapeMode
     {
-        enum Value
-        {
-            None,
-            First,
-            Second
-        };
-    }
+        None,
+        First,
+        Second
+    };
 
     IOConsole::IOConsole()
         : shell_(new Shell("Console", false))
@@ -89,7 +86,7 @@
         // Process output written to std::cout in the meantime
         std::cout.flush();
         if (!this->origCout_.str().empty())
-            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
+            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
         // Erase input and status lines
         this->cout_ << "\033[1G\033[J";
         // Move cursor to the bottom
@@ -110,7 +107,7 @@
     {
         unsigned char c;
         std::string escapeSequence;
-        EscapeMode::Value escapeMode = EscapeMode::None;
+        EscapeMode escapeMode = EscapeMode::None;
         while (std::cin.good())
         {
             c = std::cin.get();
@@ -230,7 +227,7 @@
         std::cout.flush();
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
+            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
             this->origCout_.str("");
         }
     }
@@ -240,27 +237,27 @@
         // Colour line
         switch (type)
         {
-            case Shell::Message:
-            case Shell::DebugOutput:     this->cout_ << "\033[0m"; break;
+            case Shell::LineType::Message:
+            case Shell::LineType::DebugOutput:     this->cout_ << "\033[0m"; break;
 
-            case Shell::UserError:       this->cout_ << "\033[91m"; break;
-            case Shell::UserWarning:     this->cout_ << "\033[93m"; break;
-            case Shell::UserStatus:      this->cout_ << "\033[92m"; break;
-            case Shell::UserInfo:        this->cout_ << "\033[96m"; break;
+            case Shell::LineType::UserError:       this->cout_ << "\033[91m"; break;
+            case Shell::LineType::UserWarning:     this->cout_ << "\033[93m"; break;
+            case Shell::LineType::UserStatus:      this->cout_ << "\033[92m"; break;
+            case Shell::LineType::UserInfo:        this->cout_ << "\033[96m"; break;
 
-            case Shell::InternalError:   this->cout_ << "\033[31m"; break;
-            case Shell::InternalWarning: this->cout_ << "\033[33m"; break;
-            case Shell::InternalStatus:  this->cout_ << "\033[32m"; break;
-            case Shell::InternalInfo:    this->cout_ << "\033[36m"; break;
+            case Shell::LineType::InternalError:   this->cout_ << "\033[31m"; break;
+            case Shell::LineType::InternalWarning: this->cout_ << "\033[33m"; break;
+            case Shell::LineType::InternalStatus:  this->cout_ << "\033[32m"; break;
+            case Shell::LineType::InternalInfo:    this->cout_ << "\033[36m"; break;
 
-            case Shell::Verbose:         this->cout_ << "\033[94m"; break;
-            case Shell::VerboseMore:     this->cout_ << "\033[34m"; break;
-            case Shell::VerboseUltra:    this->cout_ << "\033[34m"; break;
+            case Shell::LineType::Verbose:         this->cout_ << "\033[94m"; break;
+            case Shell::LineType::VerboseMore:     this->cout_ << "\033[34m"; break;
+            case Shell::LineType::VerboseUltra:    this->cout_ << "\033[34m"; break;
 
-            case Shell::Command:         this->cout_ << "\033[95m"; break;
-            case Shell::Hint:            this->cout_ << "\033[35m"; break;
+            case Shell::LineType::Command:         this->cout_ << "\033[95m"; break;
+            case Shell::LineType::Hint:            this->cout_ << "\033[35m"; break;
 
-            default:                     this->cout_ << "\033[37m"; break;
+            default:                               this->cout_ << "\033[37m"; break;
         }
 
         // Print output line
@@ -383,7 +380,7 @@
     //! Called if a command is about to be executed
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::LineType::Command);
     }
 
     //! Called if the console gets closed

Modified: code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/IOConsoleWindows.cc	2015-12-30 23:43:34 UTC (rev 11007)
@@ -96,7 +96,7 @@
         // Process output written to std::cout in the meantime
         std::cout.flush();
         if (!this->origCout_.str().empty())
-            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
+            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
 
         this->shell_->unregisterListener(this);
 
@@ -189,7 +189,7 @@
         std::cout.flush();
         if (!this->origCout_.str().empty())
         {
-            this->shell_->addOutput(this->origCout_.str(), Shell::Cout);
+            this->shell_->addOutput(this->origCout_.str(), Shell::LineType::Cout);
             this->origCout_.str("");
         }
     }
@@ -201,27 +201,27 @@
         WORD colour = 0;
         switch (type)
         {
-            case Shell::Message:
-            case Shell::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+            case Shell::LineType::Message:
+            case Shell::LineType::DebugOutput:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
 
-            case Shell::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
-            case Shell::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
-            case Shell::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
-            case Shell::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+            case Shell::LineType::UserError:       colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | 0              ; break;
+            case Shell::LineType::UserWarning:     colour = FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
+            case Shell::LineType::UserStatus:      colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | 0              ; break;
+            case Shell::LineType::UserInfo:        colour = FOREGROUND_INTENSITY | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
 
-            case Shell::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
-            case Shell::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
-            case Shell::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
-            case Shell::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+            case Shell::LineType::InternalError:   colour = 0                    | FOREGROUND_RED | 0                | 0              ; break;
+            case Shell::LineType::InternalWarning: colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | 0              ; break;
+            case Shell::LineType::InternalStatus:  colour = 0                    | 0              | FOREGROUND_GREEN | 0              ; break;
+            case Shell::LineType::InternalInfo:    colour = 0                    | 0              | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
 
-            case Shell::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
-            case Shell::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
-            case Shell::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+            case Shell::LineType::Verbose:         colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+            case Shell::LineType::VerboseMore:     colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
+            case Shell::LineType::VerboseUltra:    colour = FOREGROUND_INTENSITY | 0              | 0                | FOREGROUND_BLUE; break;
 
-            case Shell::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
-            case Shell::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
+            case Shell::LineType::Command:         colour = FOREGROUND_INTENSITY | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
+            case Shell::LineType::Hint:            colour = 0                    | FOREGROUND_RED | 0                | FOREGROUND_BLUE; break;
 
-            default:                     colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
+            default:                               colour = 0                    | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
         }
 
         // Print output line
@@ -330,7 +330,7 @@
     //! Called if a command is about to be executed
     void IOConsole::executed()
     {
-        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::Command);
+        this->shell_->addOutput(this->promptString_ + this->shell_->getInput(), Shell::LineType::Command);
     }
 
     //! Called if the console gets closed

Modified: code/branches/cpp11_v2/src/libraries/core/command/Shell.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Shell.cc	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/Shell.cc	2015-12-30 23:43:34 UTC (rev 11007)
@@ -267,7 +267,7 @@
     void Shell::addLine(const std::string& line, LineType type)
     {
         // yes it was - push the new line to the list
-        this->outputLines_.push_front(std::make_pair(line, static_cast<LineType>(type)));
+        this->outputLines_.push_front(std::make_pair(line, type));
 
         // adjust the scroll position if needed
         if (this->scrollPosition_)
@@ -380,9 +380,9 @@
         int error;
         const std::string& result = CommandExecutor::query(this->inputBuffer_->get(), &error);
         if (error)
-            this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", UserError);
+            this->addOutput("Error: Can't execute \"" + this->inputBuffer_->get() + "\", " + CommandExecutor::getErrorDescription(error) + ". (Shell)", LineType::UserError);
         else if (result != "")
-            this->addOutput(result, Result);
+            this->addOutput(result, LineType::Result);
 
         this->clearInput();
     }
@@ -391,7 +391,7 @@
     void Shell::hintAndComplete()
     {
         this->inputBuffer_->set(CommandExecutor::evaluate(this->inputBuffer_->get()).complete());
-        this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), Hint);
+        this->addOutput(CommandExecutor::evaluate(this->inputBuffer_->get()).hint(), LineType::Hint);
 
         this->inputChanged();
     }

Modified: code/branches/cpp11_v2/src/libraries/core/command/Shell.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Shell.h	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/libraries/core/command/Shell.h	2015-12-30 23:43:34 UTC (rev 11007)
@@ -87,7 +87,7 @@
     {
         public:
             /// Defines the type of a line of text in the Shell - some types depend on the output level, others are of internal use.
-            enum LineType
+            enum class LineType
             {
                 DebugOutput     = debug_output,
                 Message         = message,
@@ -132,8 +132,8 @@
             LineList::const_iterator getNewestLineIterator() const;
             LineList::const_iterator getEndIterator() const;
 
-            void addOutput(const std::string& text, LineType type = DebugOutput);
-            void addLine(const std::string& line, LineType type = DebugOutput);
+            void addOutput(const std::string& text, LineType type = LineType::DebugOutput);
+            void addLine(const std::string& line, LineType type = LineType::DebugOutput);
             void clearOutput();
 
             /// Returns the number of output-lines that are displayed in the shell.

Modified: code/branches/cpp11_v2/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/overlays/InGameConsole.cc	2015-12-30 22:34:25 UTC (rev 11006)
+++ code/branches/cpp11_v2/src/orxonox/overlays/InGameConsole.cc	2015-12-30 23:43:34 UTC (rev 11007)
@@ -291,7 +291,7 @@
         }
 
         for (int i = LINES - 1; i > max; --i)
-            this->print("", Shell::DebugOutput, i, true);
+            this->print("", Shell::LineType::DebugOutput, i, true);
 
         for (int i = max; i >= 1; --i)
         {
@@ -317,7 +317,7 @@
     void InGameConsole::inputChanged()
     {
         if (LINES > 0)
-            this->print(this->shell_->getInput(), Shell::Input, 0);
+            this->print(this->shell_->getInput(), Shell::LineType::Input, 0);
 
         if (this->shell_->getInput().empty())
             this->inputWindowStart_ = 0;
@@ -341,7 +341,7 @@
     */
     void InGameConsole::executed()
     {
-        this->shell_->addOutput(this->shell_->getInput(), Shell::Command);
+        this->shell_->addOutput(this->shell_->getInput(), Shell::LineType::Command);
     }
 
     /**
@@ -561,28 +561,28 @@
         ColourValue colourTop, colourBottom;
         switch (type)
         {
-            case Shell::Message:
-            case Shell::DebugOutput:     colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
+            case Shell::LineType::Message:
+            case Shell::LineType::DebugOutput:     colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
 
-            case Shell::UserError:       colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;
-            case Shell::UserWarning:     colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;
-            case Shell::UserStatus:      colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;
-            case Shell::UserInfo:        colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;
+            case Shell::LineType::UserError:       colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;
+            case Shell::LineType::UserWarning:     colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;
+            case Shell::LineType::UserStatus:      colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;
+            case Shell::LineType::UserInfo:        colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;
 
-            case Shell::InternalError:   colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;
-            case Shell::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;
-            case Shell::InternalStatus:  colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;
-            case Shell::InternalInfo:    colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;
+            case Shell::LineType::InternalError:   colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;
+            case Shell::LineType::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;
+            case Shell::LineType::InternalStatus:  colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;
+            case Shell::LineType::InternalInfo:    colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;
 
-            case Shell::Verbose:         colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;
-            case Shell::VerboseMore:     colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;
-            case Shell::VerboseUltra:    colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;
+            case Shell::LineType::Verbose:         colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;
+            case Shell::LineType::VerboseMore:     colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;
+            case Shell::LineType::VerboseUltra:    colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;
 
-            case Shell::Command:         colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;
-            case Shell::Hint:            colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;
-            case Shell::Input:           colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
+            case Shell::LineType::Command:         colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;
+            case Shell::LineType::Hint:            colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;
+            case Shell::LineType::Input:           colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;
 
-            default:                     colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;
+            default:                               colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;
         }
 
         colourBottom = ColourValue(sqrt(colourTop.r), sqrt(colourTop.g), sqrt(colourTop.b));




More information about the Orxonox-commit mailing list