Skip to content

Commit

Permalink
Also added documentation for the clear queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Hahn committed Feb 13, 2014
1 parent 0aa9b2c commit f58c581
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crane/src/main/scala/crane/World.scala
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ class World(var delta: Int=1) {
}
}

/** Processes the world **/
def process() {
/** Force clear the deleted and added queues */
def clearQueues() {
_deleted.foreach{ entity =>
_removeEntity(entity)
}
Expand All @@ -185,10 +185,16 @@ class World(var delta: Int=1) {
_addEntity(entity)
}
_added.clear()
}

/** Processes the world **/
def process() {

val tiers = _systems.keys.toList.sortWith(_ < _)
tiers.foreach{ tier =>
_systems(tier).foreach{system =>
clearQueues()
system.process(delta)}}
}
clearQueues()
}

0 comments on commit f58c581

Please sign in to comment.