Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduConditionSee.h

Go to the documentation of this file.
00001 #ifndef KODU_CONDITION_SEE_H_
00002 #define KODU_CONDITION_SEE_H_
00003 
00004 // Tekkodu Library
00005 #include "Kodu/Primitives/KoduCondition.h"
00006 #include "Kodu/Primitives/PerceptionSearch.h"
00007 #include "Kodu/Keepers/ObjectKeeper.h"
00008 
00009 // Tekkotsu Library
00010 #include "DualCoding/ShapeRoot.h"
00011 #include "DualCoding/ShapeCylinder.h"
00012 
00013 namespace Kodu {
00014 
00015     class KoduWorld;
00016 
00017     class KoduConditionSee : public KoduCondition {
00018     public:
00019         //! Constructor
00020         KoduConditionSee(bool useNot, const std::string& kObjectType, const std::string& kObjectColor,
00021             SearchLocation_t locationToSearch)
00022           : KoduCondition("KoduConditionSee", KoduCondition::CT_SEE),
00023             notModifierEnabled(useNot),
00024             objType(kObjectType),
00025             objColor(kObjectColor),
00026             searchLocation(locationToSearch),
00027             refdObject()
00028         { }
00029 
00030         //! Copy constructor
00031         KoduConditionSee(const KoduConditionSee& kCondition)
00032           : KoduCondition(kCondition),
00033             notModifierEnabled(kCondition.notModifierEnabled),
00034             objType(kCondition.objType),
00035             objColor(kCondition.objColor),
00036             searchLocation(kCondition.searchLocation),
00037             refdObject(kCondition.refdObject)
00038         { }
00039 
00040         //! Destructor
00041         ~KoduConditionSee() {
00042             // no explicit implementation
00043         }
00044 
00045         //! Assignment operator
00046         KoduConditionSee& operator=(const KoduConditionSee& kCondition) {
00047             if (this != &kCondition) {
00048                 KoduCondition::operator=(kCondition);
00049                 notModifierEnabled = kCondition.notModifierEnabled;
00050                 objType = kCondition.objType;
00051                 objColor = kCondition.objColor;
00052                 searchLocation = kCondition.searchLocation;
00053                 refdObject = kCondition.refdObject;
00054             }
00055             return *this;
00056         }
00057 
00058         //! Checks if a specified object was seen
00059         virtual bool evaluate(const KoduWorld&);
00060 
00061         //! Returns a specified object's color
00062         const std::string& getObjectColor() const;
00063 
00064         //! Returns a specified object's type
00065         const std::string& getObjectType() const;
00066 
00067         //! Returns the target object... if none is available, return an invalid object
00068         const DualCoding::ShapeRoot getTargetObject();
00069 
00070         //! Tests if the primitive argument is the same as the calling class
00071         static bool isSameTypeAs(const KoduPrimitive*);
00072 
00073         //! Used to reinitialize certain variables (e.g. when switching to another page)
00074         virtual void reinitialize();
00075         
00076         //! Prints the attributes of a particular instance
00077         virtual void printAttrs() const;
00078 
00079     private:
00080         bool notModifierEnabled;
00081         std::string objType;
00082         std::string objColor;
00083         SearchLocation_t searchLocation;
00084         DualCoding::ShapeRoot refdObject;
00085     };
00086 }
00087 
00088 #endif // KODU_CONDITION_SEE_H_

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