Skip to content

Commit

Permalink
Added copy function for entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Hahn committed Feb 26, 2014
1 parent d83ce80 commit 26a812f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crane/src/main/scala/crane/Entity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ class Entity(var tag:String = "") {
val components = ArrayBuffer.empty[Component]
val uuid: String = java.util.UUID.randomUUID.toString

def copy(): Entity = {
val e: new Entity(tag)
e.alive = alive
e.components = e.components
}

override def toString: String = {
components.map{component =>
component.toString
Expand Down

0 comments on commit 26a812f

Please sign in to comment.