lib/atome/kernel/universe.rb in atome-0.4.5.4 vs lib/atome/kernel/universe.rb in atome-0.4.7.0

- old
+ new

@@ -9,15 +9,23 @@ # in this case parent is eve so 0, Software instance number is main eVe server which is also 0, # and finally the object is 3 as this the third object created by the main server end def self.initialize - @atomes = [] + @atomes = {} end - def self.atomes_add(new_atome) - # @atomes[atome_id] = new_atome - @atomes << new_atome + def self.atomes_add(new_atome,atome_id) + new_atome.instance_variable_set('@id', atome_id) + @atomes[atome_id] = new_atome + end + + def self.change_atome_id(prev_id, new_id) + @atomes[new_id] = @atomes.delete(prev_id) + end + + def self.delete(id) + @atomes.delete(id) end class << self attr_reader :atomes end