+/*
+ * MapState.cpp
+ *
+ * Created on: Sep 29, 2012
+ * Author: holy
+ */
+
+#include "MapState.h"
+
+#include "Map.h"
+#include "../app/Application.h"
+#include "../app/Input.h"
+
+using app::Application;
+using app::Input;
+using geometry::Vector;
+
+namespace map {
+
+MapState::MapState(const Map *map)
+: map(map)
+, tempTarget(20, 20)
+, camera(100, 100, &tempTarget) {
+
+}
+
+
+void MapState::EnterState(Application &ctrl, SDL_Surface *screen) {
+ camera.Resize(screen->w, screen->h);
+}
+
+void MapState::ExitState(Application &ctrl, SDL_Surface *screen) {
+
+}
+
+void MapState::ResumeState(Application &ctrl, SDL_Surface *screen) {
+ camera.Resize(screen->w, screen->h);
+}
+
+void MapState::PauseState(Application &ctrl, SDL_Surface *screen) {
+
+}
+
+void MapState::Resize(int width, int height) {
+ camera.Resize(width, height);
+}
+
+
+void MapState::HandleEvents(const Input &input) {
+
+}
+
+void MapState::UpdateWorld(float deltaT) {
+
+}
+
+void MapState::Render(SDL_Surface *screen) {
+ Vector<int> offset(camera.CalculateOffset());
+ map->Render(screen, offset);
+}
+
+}