Guest User

GQE - IPROPERTY- HEADER

a guest
Jan 24th, 2013
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.49 KB | None | 0 0
  1. #ifndef IPROPERTY_HPP_INCLUDED
  2. #define IPROPERTY_HPP_INCLUDED
  3.  
  4. namespace GQE
  5. {
  6.   /// Provides the interface for all IEntity properties
  7.   class IProperty
  8.   {
  9.     public:
  10.       /// Class that represents the type for this class
  11.       class Type_t
  12.       {
  13.         private:
  14.           std::string mName;
  15.         public:
  16.           explicit Type_t(std::string theName) : mName(theName) {}
  17.           std::string Name() const
  18.           {
  19.             return mName;
  20.           };
  21.       };
  22.  
  23.       /**
  24.        * IProperty default constructor
  25.        * @param[in] theType of property this property represents
  26.        * @param[in] thePropertyID to use for this property
  27.        */
  28.       IProperty(std::string theType, const std::string thePropertyID);
  29.  
  30.       /**
  31.        * IProperty destructor
  32.        */
  33.       virtual ~IProperty();
  34.  
  35.       /**
  36.        * GetType will return the Type_t type for this property
  37.        * @return the Type_t class for this property
  38.        */
  39.       Type_t* GetType(void);
  40.  
  41.       /**
  42.        * GetID will return the Property ID used for this property.
  43.        * @return the property ID for this property
  44.        */
  45.       const std::string GetID(void) const;
  46.  
  47.       /**
  48.        * Update will be called for each IProperty registered with IEntity and
  49.        * enable each IProperty derived class to perform Update related tasks
  50.        * (e.g. frame counter, timer update, decreate in shields, etc).
  51.        */
  52.       virtual void Update() = 0;
  53.  
  54.       /**
  55.        * MakeClone is responsible for creating a clone of this IProperty
  56.        * derived class and returning it as part of the Prototype and Instance
  57.        * system. The value of the Property will also be copied into the clone.
  58.        * @return pointer to the IProperty derived class clone that was created
  59.        */
  60.       virtual IProperty* MakeClone() = 0;
  61.  
  62.     protected:
  63.       /**
  64.        * SetType is responsible for setting the type of class this IProperty
  65.        * class represents and is usually called by the IProperty derived class
  66.        * to set theType.
  67.        * @param[in] theType to set for this IProperty derived class
  68.        */
  69.       void SetType(std::string theType);
  70.  
  71.     private:
  72.       // Variables
  73.       ///////////////////////////////////////////////////////////////////////////
  74.       /// The type that represents this class
  75.       Type_t mType;
  76.       /// The property ID assigned to this IProperty derived class
  77.       const std::string mPropertyID;
  78.   };
  79. } // namespace GQE
  80. #endif //IPROPERTY_HPP_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment