Module: Beefdump::World
- Defined in:
- lib/beefdump/world/world.rb,
lib/beefdump/world/entity.rb,
lib/beefdump/world/object.rb,
lib/beefdump/world/player.rb,
lib/beefdump/world/object_property.rb
Defined Under Namespace
Classes: Entity, Object, ObjectProperty, Player
Class Method Summary collapse
-
.load ⇒ Object
Loads the object descriptions from the objects.xml file in the config folder.
- .objects ⇒ Object
Class Method Details
.load ⇒ Object
Loads the object descriptions from the objects.xml file in the config folder.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/beefdump/world/world.rb', line 9 def self.load objects_file = "#{CONFIG_PATH}/objects.xml" raise "Objects configuration missing! Please supply '#{objects_file}'." unless File.exist?(objects_file) raise "Object configuration format invalid!" unless objectset = XmlSimple.xml_in(objects_file)["object"] @objects = {} objectset.each do |object_data| object = Object.new(object_data) @objects[object.type] = object end end |
.objects ⇒ Object
21 22 23 |
# File 'lib/beefdump/world/world.rb', line 21 def self.objects @objects end |