Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Modifier.h

Go to the documentation of this file.
00001 
00024 #ifdef __cplusplus
00025 
00026 #  ifndef OGS_CORE_MODIFIER_H
00027 #    define OGS_CORE_MODIFIER_H
00028 
00029 #    include <string>
00030 
00031 #    include <ogs/support/Event.h>
00032 #    include <ogs/support/Object.h>
00033 #    include <ogs/core/Namespace.h>
00034 
00035 OGS_BEGIN_CORE_NAMESPACE
00036 
00045 class Modifier: public ogs::support::Object {
00046   public:
00052     typedef short Value;
00053 
00054     class Event;
00055 
00056     Modifier (Value value = 0);
00057 
00058     Value getValue () const;
00059     void setValue (Value value);
00060 
00061     std::string toString () const;
00062 
00063   private:
00064     Value _value;
00065 };
00066 
00072 inline
00073 Modifier::Modifier (Value value):
00074   _value (value) {
00075   // empty constructor body
00076 }
00077 
00083 inline Modifier::Value
00084 Modifier::getValue () const {
00085   return (this->_value);
00086 }
00087 
00093 class Modifier::Event: public ogs::support::Event {
00094   public:
00095     Value getPreviousValue () const;
00096 
00097   private:
00098     Value _value;
00099     Event (Modifier& modifier);
00100     friend void Modifier::setValue (Value value);
00101 };
00102 
00108 inline
00109 Modifier::Event::Event (Modifier& modifier):
00110   ogs::support::Event (modifier), _value (modifier.getValue ()) {
00111   // empty constructor body
00112 }
00113 
00119 inline Modifier::Value
00120 Modifier::Event::getPreviousValue () const {
00121   return (this->_value);
00122 }
00123 
00124 OGS_END_CORE_NAMESPACE
00125 
00126 #  endif /* !defined OGS_CORE_MODIFIER_H */
00127 
00128 #endif /* defined __cplusplus */
00129 

Generated on Sun Apr 20 03:36:22 2003 for Open Gaming System (OGS) by doxygen1.3