4 * Created on: Sep 29, 2012
8 #ifndef MAP_MAPSTATE_H_
9 #define MAP_MAPSTATE_H_
13 #include "../app/State.h"
14 #include "../geometry/Vector.h"
15 #include "../graphics/Camera.h"
25 explicit MapState(const Map *);
26 virtual ~MapState() { }
29 virtual void EnterState(app::Application &ctrl, SDL_Surface *screen);
30 virtual void ExitState(app::Application &ctrl, SDL_Surface *screen);
31 virtual void ResumeState(app::Application &ctrl, SDL_Surface *screen);
32 virtual void PauseState(app::Application &ctrl, SDL_Surface *screen);
33 virtual void Resize(int width, int height);
35 virtual void HandleEvents(const app::Input &);
36 virtual void UpdateWorld(float deltaT);
37 virtual void Render(SDL_Surface *);
40 void AddEntity(Entity *e) { entities.push_back(e); }
41 void ControlEntity(Entity *e) { controlled = e; camera.SetTarget(&e->Position()); }
43 void SetWalkingSpeed(float s) { walkingSpeed = s; }
46 static bool ZCompare(const Entity *lhs, const Entity *rhs);
53 geometry::Vector<float> tempTarget;
54 geometry::Vector<int> lastLock;
55 graphics::Camera camera;
56 std::vector<Entity *> entities;
65 #endif /* MAP_MAPSTATE_H_ */