#include "WorldState.hpp"
#include "Environment.hpp"
+#include "UnloadState.hpp"
#include <SDL.h>
WorldState::WorldState(
Environment &env,
const Interface::Config &ic,
- const World::Config &wc
+ const World::Config &wc,
+ const WorldSave &save
)
: env(env)
-, world(wc)
+, world(env.assets, wc, save)
, spawner(world)
, interface(ic, env, world) {
case SDL_MOUSEWHEEL:
interface.Handle(event.wheel);
break;
+ case SDL_QUIT:
+ // don't care about this leak just now
+ env.state.Switch(new UnloadState(env, world.Loader()));
+ break;
default:
break;
}