X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fblobs.cpp;h=1cd3f9fad69cb6b01c60d67cf34264ab5cdd833f;hp=f5cc98842b0c13280761b8004c176277a847625a;hb=200f9da6241613a1c19431896b09d1715c262c6d;hpb=76c09039792065ca1c259fb4b681c84c29a9dbd8 diff --git a/src/blobs.cpp b/src/blobs.cpp index f5cc988..1cd3f9f 100644 --- a/src/blobs.cpp +++ b/src/blobs.cpp @@ -15,36 +15,6 @@ using namespace blobs; -namespace { - -struct SwitchPanel { - SwitchPanel(world::Planet &p, app::Application &app, app::MasterState &state) - : planet(p), app(app), state(state) { } - - void operator ()(creature::Creature &c) { - if (planet.Creatures().empty()) { - planet.GetSimulation().Log() << "no more creatures, game over" << std::endl; - state.GetCreaturePanel().Hide(); - while (app.HasState()) { - app.PopState(); - } - } else { - for (auto a : planet.Creatures()) { - if (a != &c) { - state.GetCreaturePanel().Show(*a); - a->WhenDead([&](creature::Creature &b) { (*this)(b); }); - break; - } - } - } - } - - world::Planet &planet; - app::Application &app; - app::MasterState &state; -}; -} - int main(int argc, char *argv[]) { app::Init init(true, 8); app::Assets assets; @@ -101,8 +71,6 @@ int main(int argc, char *argv[]) { state.GetTimePanel().SetBody(planet); app::Application app(init.window, init.viewport); - SwitchPanel swp(planet, app, state); - blob->WhenDead([&](creature::Creature &c) { swp(c); }); app.PushState(&state); app.Run();