KoduConditionSee.h
Go to the documentation of this file.00001 #ifndef KODU_CONDITION_SEE_H_
00002 #define KODU_CONDITION_SEE_H_
00003
00004
00005 #include "Kodu/Primitives/KoduCondition.h"
00006 #include "Kodu/Primitives/PerceptionSearch.h"
00007 #include "Kodu/Keepers/ObjectKeeper.h"
00008
00009
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
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
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
00041 ~KoduConditionSee() {
00042
00043 }
00044
00045
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
00059 virtual bool evaluate(const KoduWorld&);
00060
00061
00062 const std::string& getObjectColor() const;
00063
00064
00065 const std::string& getObjectType() const;
00066
00067
00068 const DualCoding::ShapeRoot getTargetObject();
00069
00070
00071 static bool isSameTypeAs(const KoduPrimitive*);
00072
00073
00074 virtual void reinitialize();
00075
00076
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_