Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 30, 2015, 2:31:14 PM (8 years ago)
Author:
landauf
Message:

using strongly typed enum classes in various modules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/modules/objects/Script.h

    r10817 r10999  
    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    };
Note: See TracChangeset for help on using the changeset viewer.