lib/gemwarrior/world.rb in gemwarrior-0.9.36 vs lib/gemwarrior/world.rb in gemwarrior-0.9.37
- old
+ new
@@ -8,18 +8,16 @@
require_relative 'entities/location'
module Gemwarrior
class World
# CONSTANTS
- LOCATION_DATA_FILE = File.expand_path('../../../data/locations.yml', __FILE__)
- WORLD_DIM_WIDTH = 10
- WORLD_DIM_HEIGHT = 10
+ LOCATION_DATA_FILE = File.expand_path('../../../data/locations.yml', __FILE__)
+ ERROR_LIST_PARAM_INVALID = 'That is not something that can be listed.'
+ ERROR_DESCRIBE_ENTITY_INVALID = 'You do not see that here.'
+ WORLD_DIM_WIDTH = 10
+ WORLD_DIM_HEIGHT = 10
- ## ERRORS
- ERROR_LIST_PARAM_INVALID = 'That is not something that can be listed.'
- ERROR_LOCATION_DESCRIBE_ENTITY_INVALID = 'You do not see that here.'
-
attr_accessor :monsters, :locations, :player
def initialize
self.monsters = init_monsters
self.locations = init_locations
@@ -204,10 +202,10 @@
end
end
elsif player.inventory.contains_item?(entity_name)
player.inventory.describe_item(entity_name)
else
- ERROR_LOCATION_DESCRIBE_ENTITY_INVALID
+ ERROR_DESCRIBE_ENTITY_INVALID
end
end
def can_move?(direction)
location_by_coords(player.cur_coords).has_loc_to_the?(direction)