Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

world.hh

Go to the documentation of this file.
00001 #ifndef _world_hh_
00002 #define _world_hh_
00003 
00004 #include "abstractworld.hh"
00005 #include <SDL/SDL.h>
00006 #include "stringhash.hh"
00007 #include <deque>
00008 
00009 namespace anoid {
00010     namespace main {
00011 
00012         class World: public base::AbstractWorld {
00013             private:
00014                 Uint32 old;
00015                 int maxid;
00017                 double time;
00019                 double G;
00020                 std::vector<base::Element*> childrenE;
00021                 std::deque<base::Event*> events;
00022                 string_map< vector<base::Object *> > listeners;
00023                 context::Context *_context;
00024             public:
00025                 virtual base::Object *loadObject(const std::string &name);
00026                 virtual int getFreshID();
00034                 World(config::Configuration &c, context::Context *context, double g = 6.6726E-11);
00035                 virtual void init(config::Configuration &c);
00036                 virtual double getTime() { return time; }
00037                 virtual double getG() { return G; }
00038                 virtual vector<base::Object*>::iterator begin();
00039                 virtual vector<base::Object*>::iterator end();
00040                 virtual base::Object *add(base::Object *o);
00041                 virtual std::vector<base::Element*>::iterator beginE() { return childrenE.begin(); }
00042                 virtual std::vector<base::Element*>::iterator endE() { return childrenE.end(); }
00043                 virtual void update();
00044                 virtual void redraw();
00045                 virtual void send(base::Event *e);
00046                 virtual void listen(base::Object *o, const std::string &m);
00047                 virtual void fireEvents();
00048                 virtual base::Event *loadEvent(const std::string &name);
00049                 virtual base::Event *loadEvent(const std::string &name, config::Configuration &c);
00050                 virtual base::Event *sendEvent(const std::string &name);
00051                 virtual base::Event *sendEvent(const std::string &name, base::Object *o1);
00052                 virtual base::Event *sendEvent(const std::string &name, base::Object *o1, base::Object *o2);
00053                 virtual base::Event *sendEvent(const std::string &name, base::Object *o1, base::Object *o2, base::Object *o3);
00054                 virtual context::Context *getContext() { return _context; }
00055         };
00056 
00057     };
00058 };
00059 #endif

Anoid NG © Michael Westergaard, Martin Stig Stissing, Ronni Michael Laursen, and Kristian Bisgaard Lassen