Skip to content

Commit

Permalink
Lazy initialization, better for Geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
ouly committed Sep 15, 2010
1 parent 4a46c26 commit 7d5ce99
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions source/engine/Entity.ooc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,30 @@ Entity: class {
name: String
id: Int

props := HashMap<String, Property> new()
updates := ArrayList<Update> new()
receivers := ArrayList<Receiver> new()
queue := ArrayList<Message> new()
props : HashMap<String, Property> {
get {
if (!props) props = HashMap<String, Property> new()
return props
}
}
updates : ArrayList<Update> {
get {
if (!updates) updates = ArrayList<Update> new()
return updates
}
}
receivers : ArrayList<Receiver> {
get {
if (!receivers) receivers = ArrayList<Receiver> new()
return receivers
}
}
queue : ArrayList<Message> {
get {
if (!queue) queue = ArrayList<Message> new()
return queue
}
}

idSeed := static 0

Expand Down

0 comments on commit 7d5ce99

Please sign in to comment.