externalize boot process

Booting is complicated, make an own file for it
This commit is contained in:
Torsten Ruger
2015-05-19 20:29:33 +03:00
parent 4e3640e432
commit 8ec8a519ba
5 changed files with 122 additions and 82 deletions

View File

@ -32,6 +32,7 @@ module Parfait
@messages = 100.times.collect{ ::Parfait::Message.new }
@next_message = @messages.first
@next_frame = @frames.first
Parfait::Space.set_object_space self
end
attr_reader :classes , :objects , :symbols,:messages, :next_message , :next_frame
@ -41,6 +42,16 @@ module Parfait
@@SPACE
end
@@object_space = nil
# Make the object space globally available
def self.object_space
@@object_space
end
# TODO Must get rid of the setter
def self.set_object_space space
@@space = space
end
# Objects are data and get assembled after functions
def add_object o
return if @objects.include?(o)