Class: ItemLibrary::BaseItem
- Inherits:
-
Object
- Object
- ItemLibrary::BaseItem
- Defined in:
- lib/natural_20/item_library/base_item.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #consumable? ⇒ Boolean
-
#initialize(name, properties) ⇒ BaseItem
constructor
A new instance of BaseItem.
- #item? ⇒ Boolean
- #use!(battle, map, entity) ⇒ Object
Constructor Details
#initialize(name, properties) ⇒ BaseItem
Returns a new instance of BaseItem.
6 7 8 9 |
# File 'lib/natural_20/item_library/base_item.rb', line 6 def initialize(name, properties) @name = name @properties = properties end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/natural_20/item_library/base_item.rb', line 4 def name @name end |
Instance Method Details
#consumable? ⇒ Boolean
11 12 13 |
# File 'lib/natural_20/item_library/base_item.rb', line 11 def consumable? !!@properties[:consumable] end |
#item? ⇒ Boolean
15 16 17 |
# File 'lib/natural_20/item_library/base_item.rb', line 15 def item? true end |
#use!(battle, map, entity) ⇒ Object
19 |
# File 'lib/natural_20/item_library/base_item.rb', line 19 def use!(battle, map, entity); end |