1
0

Replace ItemCallbacks with lambdas (#3993)

This commit is contained in:
peterbell10
2017-09-11 22:20:49 +01:00
committed by Mattes D
parent 115bc5609a
commit e225b7f826
69 changed files with 919 additions and 1817 deletions

View File

@@ -498,26 +498,20 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
}
if (split[0] == "destroyentities")
{
class WorldCallback : public cWorldListCallback
{
virtual bool Item(cWorld * a_World) override
cRoot::Get()->ForEachWorld([](cWorld & a_World)
{
class EntityCallback : public cEntityCallback
{
virtual bool Item(cEntity * a_Entity) override
a_World.ForEachEntity([](cEntity & a_Entity)
{
if (!a_Entity->IsPlayer())
if (!a_Entity.IsPlayer())
{
a_Entity->Destroy();
a_Entity.Destroy();
}
return false;
}
} EC;
a_World->ForEachEntity(EC);
);
return false;
}
} WC;
cRoot::Get()->ForEachWorld(WC);
);
a_Output.Out("Destroyed all entities");
a_Output.Finished();
return;