Class: Gemwarrior::Entity
- Inherits:
-
Object
- Object
- Gemwarrior::Entity
- Defined in:
- lib/gemwarrior/entities/entity.rb
Instance Attribute Summary collapse
-
#consumable ⇒ Object
Returns the value of attribute consumable.
-
#describe(world) ⇒ Object
readonly
Returns the value of attribute describe.
-
#describe_detailed(world) ⇒ Object
readonly
Returns the value of attribute describe_detailed.
-
#description ⇒ Object
Returns the value of attribute description.
-
#display_shopping_cart(cart) ⇒ Object
readonly
Returns the value of attribute display_shopping_cart.
-
#equippable ⇒ Object
Returns the value of attribute equippable.
-
#equipped ⇒ Object
Returns the value of attribute equipped.
-
#name ⇒ Object
Returns the value of attribute name.
-
#name_display ⇒ Object
Returns the value of attribute name_display.
-
#number_of_uses ⇒ Object
Returns the value of attribute number_of_uses.
-
#takeable ⇒ Object
Returns the value of attribute takeable.
-
#talkable ⇒ Object
Returns the value of attribute talkable.
-
#useable ⇒ Object
Returns the value of attribute useable.
-
#useable_battle ⇒ Object
Returns the value of attribute useable_battle.
-
#used ⇒ Object
Returns the value of attribute used.
-
#used_again ⇒ Object
Returns the value of attribute used_again.
Instance Method Summary collapse
-
#initialize ⇒ Entity
constructor
A new instance of Entity.
- #puts(s = '', width = GameOptions.data['wrap_width']) ⇒ Object
- #use(world) ⇒ Object
Constructor Details
#initialize ⇒ Entity
Returns a new instance of Entity.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gemwarrior/entities/entity.rb', line 28 def initialize self.name = 'entity' self.name_display = Formatting::upstyle(name) self.description = 'An entity.' self.useable = true self.useable_battle = false self.talkable = false self.consumable = false self.takeable = true self.equippable = false self.equipped = false self.used = false self.used_again = false self.number_of_uses = nil end |
Instance Attribute Details
#consumable ⇒ Object
Returns the value of attribute consumable.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def consumable @consumable end |
#describe(world) ⇒ Object (readonly)
Returns the value of attribute describe.
24 25 26 |
# File 'lib/gemwarrior/entities/entity.rb', line 24 def describe @describe end |
#describe_detailed(world) ⇒ Object (readonly)
Returns the value of attribute describe_detailed.
24 25 26 |
# File 'lib/gemwarrior/entities/entity.rb', line 24 def describe_detailed @describe_detailed end |
#description ⇒ Object
Returns the value of attribute description.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def description @description end |
#display_shopping_cart(cart) ⇒ Object (readonly)
Returns the value of attribute display_shopping_cart.
24 25 26 |
# File 'lib/gemwarrior/entities/entity.rb', line 24 def display_shopping_cart @display_shopping_cart end |
#equippable ⇒ Object
Returns the value of attribute equippable.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def equippable @equippable end |
#equipped ⇒ Object
Returns the value of attribute equipped.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def equipped @equipped end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def name @name end |
#name_display ⇒ Object
Returns the value of attribute name_display.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def name_display @name_display end |
#number_of_uses ⇒ Object
Returns the value of attribute number_of_uses.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def number_of_uses @number_of_uses end |
#takeable ⇒ Object
Returns the value of attribute takeable.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def takeable @takeable end |
#talkable ⇒ Object
Returns the value of attribute talkable.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def talkable @talkable end |
#useable ⇒ Object
Returns the value of attribute useable.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def useable @useable end |
#useable_battle ⇒ Object
Returns the value of attribute useable_battle.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def useable_battle @useable_battle end |
#used ⇒ Object
Returns the value of attribute used.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def used @used end |
#used_again ⇒ Object
Returns the value of attribute used_again.
10 11 12 |
# File 'lib/gemwarrior/entities/entity.rb', line 10 def used_again @used_again end |
Instance Method Details
#puts(s = '', width = GameOptions.data['wrap_width']) ⇒ Object
72 73 74 |
# File 'lib/gemwarrior/entities/entity.rb', line 72 def puts(s = '', width = GameOptions.data['wrap_width']) super s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n") unless s.nil? end |
#use(world) ⇒ Object
44 45 46 |
# File 'lib/gemwarrior/entities/entity.rb', line 44 def use(world) 'That does not appear to be useable.' end |