From 3ead974ee293d5f6c1bc38a075ff042df7ed46f2 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Sat, 8 Aug 2015 12:21:24 +0200 Subject: [PATCH] added comments --- core/src/logic/World.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/logic/World.java b/core/src/logic/World.java index 3cb425a..e83e709 100644 --- a/core/src/logic/World.java +++ b/core/src/logic/World.java @@ -114,6 +114,7 @@ public class World implements Runnable { public void update() { if (cmdRestart) { + // Clear everything and start over elements.clear(); graveyard.clear(); creatures.clear(); @@ -129,6 +130,7 @@ public class World implements Runnable { Log.log(Log.INFO, "Reached maximum generation time (" + maximumTicksPerGen + ")"); newGen(false); } + // Add stuff to the world for (Element e : toAdd) { elements.add(e); if (e instanceof Creature) { @@ -138,10 +140,11 @@ public class World implements Runnable { } } toAdd.clear(); + // Clear creature from graveyard elements.removeAll(graveyard); if (selected != null && graveyard.contains(selected)) { selected = null; - Log.log(Log.INFO, "Cleared selection"); + Log.log(Log.DEBUG, "Cleared selection"); } elements.removeAll(deadPlants); plants.removeAll(deadPlants); @@ -150,6 +153,7 @@ public class World implements Runnable { fire(Listener.CREATURE_LIST_CHANGED); } if (cmdLaunchNewGen) { + // Skip to new generation newGen(false); cmdLaunchNewGen = false; }