Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduConditionGot.h

Go to the documentation of this file.
00001 #ifndef KODU_CONDITION_GOT_H_
00002 #define KODU_CONDITION_GOT_H_
00003 
00004 // INCLUDES
00005 // tekkodu Library
00006 #include "Kodu/Primitives/KoduCondition.h"
00007 
00008 // Tekkotsu Library
00009 #include "DualCoding/ShapeRoot.h"
00010 
00011 // C++ Library
00012 #include <iostream>
00013 
00014 namespace Kodu {
00015 
00016     // forward declarations
00017     class KoduWorld;
00018 
00019     class KoduConditionGot : public KoduCondition {
00020     public:
00021         //! Constructor
00022         KoduConditionGot(bool useNot, const std::string& kObjectType, const std::string& kObjectColor)
00023           : KoduCondition("KoduConditionGot", KoduCondition::CT_GOT),
00024             notModifierEnabled(useNot),
00025             objType(kObjectType),
00026             objColor(kObjectColor)
00027         { }
00028 
00029         //! Copy constructor
00030         KoduConditionGot(const KoduConditionGot& kCondition)
00031           : KoduCondition(kCondition),
00032             notModifierEnabled(kCondition.notModifierEnabled),
00033             objType(kCondition.objType),
00034             objColor(kCondition.objColor)
00035         { }
00036 
00037         //! Destructor
00038         ~KoduConditionGot() {
00039             // no explicit implementation
00040         }
00041 
00042         //! Assignment operator
00043         KoduConditionGot& operator=(const KoduConditionGot& kCondition) {
00044             if (this != &kCondition) {
00045                 KoduCondition::operator=(kCondition);
00046                 notModifierEnabled = kCondition.notModifierEnabled;
00047                 objType = kCondition.objType;
00048                 objColor = kCondition.objColor;
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;
00058 
00059         //! Returns a specified object's type
00060         const std::string& getObjectType() const;
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     };
00076 }
00077 
00078 #endif // KODU_CONDITION_GOT_H_

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