Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduWorld.h

Go to the documentation of this file.
00001 #ifndef KODU_WORLD_H_
00002 #define KODU_WORLD_H_
00003 
00004 // INCLUDES
00005 // c++
00006 #include <map>
00007 #include <queue>
00008 #include <vector>
00009 
00010 // tekkotsu
00011 #include "DualCoding/PolygonData.h"
00012 #include "DualCoding/ShapeAprilTag.h"
00013 #include "DualCoding/ShapePolygon.h"
00014 #include "DualCoding/ShapeRoot.h"
00015 using namespace DualCoding;
00016 
00017 // tekkodu
00018 #include "Kodu/KoduAgent.h"
00019 #include "Kodu/General/GeneralMacros.h"
00020 #include "Kodu/Keepers/ScoreKeeper.h"
00021 
00022 namespace Kodu {
00023 
00024     class KoduWorld {
00025     public:
00026         //! Constructor
00027         KoduWorld();
00028 
00029         //! Destructor
00030         ~KoduWorld();
00031 
00032         /// ================================ Scoring functions ================================ ///
00033         //! Applies the scores changes to the global score keeper
00034         void applyGlobalScoreChanges(std::queue<ScoreChange>&);
00035 
00036         //! Returns the value of a particular score (identified by the designator)
00037         static int getScoreValue(const std::string&);
00038 
00039         /// ================================ Shape-Tag Pair functions ========================= ///
00040         //! Returns the april tag id corresponding to a particular shape id
00041         int getTagIdForShape(int);
00042 
00043         //! Checks if a shapt-tag pair exists
00044         bool shapeTagPairExists(int) const;
00045 
00046         //! Pairs an april tag with a particular shape
00047         void pairShapeWithTag(int, int);
00048 
00049         /// ================================ World Bounds and North Star functions =========== ///
00050         //! Returns the world North Star
00051         const Point& getNorthStarLocation() const;
00052 
00053         //! Returns the "stars" seen and their location
00054         const std::map<int, Point>& getStarConstellation() const;
00055 
00056         //! Returns the world bounds polygon
00057         const Shape<PolygonData>& getWorldBoundsPolygon() const;
00058 
00059         //! Creates the world bounds polygon
00060         void generateWorldBoundsPolygon();
00061 
00062         //! Sets the "stars" seen and their allocentric locations
00063         void setStarConstellation(const std::vector<ShapeRoot>&);
00064 
00065     private:
00066         //! Disallows the copy constructor and assignment operator
00067         DISALLOW_COPY_ASSIGN(KoduWorld);
00068 
00069     public:
00070         //! Represents the agent that the Kodu Behavior is running on
00071         KoduAgent thisAgent;
00072 
00073     private:
00074         //! Local copy of the Score Keeper
00075         static ScoreKeeper globalScoreKeeper;
00076 
00077         //! Helps the robot discern between multiple objects of same type and color when near them
00078         std::map<int, int> shapeToTagMap;
00079 
00080         //! A map of the april tag (used as stars) and their allocentric positions
00081         std::map<int, Point> starConstellation;
00082 
00083         //! The world bounds polygon
00084         Shape<PolygonData> worldBoundsPolygon;
00085 
00086         //! The length of the world's sides; all sides are the same length making the world a square
00087         const float worldSideLength;
00088     };
00089 }
00090 
00091 #endif // end of KODU_WORLD_H_

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