Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduConditionHear.h

Go to the documentation of this file.
00001 #ifndef KODU_CONDITION_HEAR_H_
00002 #define KODU_CONDITION_HEAR_H_
00003 
00004 // INCLUDES
00005 // tekkodu Library
00006 #include "Kodu/Primitives/KoduCondition.h"
00007 
00008 // C++ Library
00009 #include <iostream>
00010 
00011 namespace Kodu {
00012 
00013     // forward declarations
00014     class KoduWorld;
00015 
00016     class KoduConditionHear : public KoduCondition {
00017     public:
00018         //! Constructor
00019       KoduConditionHear(bool useNot, const std::string& kObjectType, const std::string& kObjectColor, const std::string& kSaid)
00020         : KoduCondition("KoduConditionHear", KoduCondition::CT_HEAR),
00021             notModifierEnabled(useNot),
00022             objType(kObjectType),
00023             objColor(kObjectColor),
00024             said(kSaid)
00025         { }
00026 
00027         //! Copy constructor
00028         KoduConditionHear(const KoduConditionHear& kCondition)
00029           : KoduCondition(kCondition),
00030             notModifierEnabled(kCondition.notModifierEnabled),
00031             objType(kCondition.objType),
00032             objColor(kCondition.objColor),
00033             said(kCondition.said)
00034         { }
00035 
00036         //! Destructor
00037         ~KoduConditionHear() {
00038             // no explicit implementation
00039         }
00040 
00041         //! Assignment operator
00042         KoduConditionHear& operator=(const KoduConditionHear& kCondition) {
00043             if (this != &kCondition) {
00044                 KoduCondition::operator=(kCondition);
00045                 notModifierEnabled = kCondition.notModifierEnabled;
00046                 objType = kCondition.objType;
00047                 objColor = kCondition.objColor;
00048                 said = kCondition.said;
00049             }
00050             return *this;
00051         }
00052 
00053         //! Checks if a specified object was bumped
00054         virtual bool evaluate(const KoduWorld&);
00055 
00056         //! Returns a specified object's color
00057         const std::string& getObjectColor() const { return objColor; }
00058 
00059         //! Returns a specified object's type
00060         const std::string& getObjectType() const { return objType; }
00061 
00062         //! Returns the target object... if none is available, return an invalid object
00063         const DualCoding::ShapeRoot getTargetObject();
00064 
00065         //! Used to reinitialize certain variables (e.g. when switching to another page)
00066         virtual void reinitialize();
00067         
00068         //! Prints the attributes of a particular instance
00069         virtual void printAttrs() const;
00070         
00071     private:
00072         bool notModifierEnabled;
00073         std::string objType;
00074         std::string objColor;
00075         std::string said;
00076     };
00077 }
00078 
00079 #endif // KODU_CONDITION_HEAR_H_

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:43 2016 by Doxygen 1.6.3