Module: Standardized
- Included in:
- Gamefic::Entity
- Defined in:
- lib/gamefic-standard/modules/standardized.rb
Instance Attribute Summary collapse
- #itemized ⇒ Boolean writeonly
-
#locale_description ⇒ String?
An optional description to use when itemizing entities in room descriptions.
- #portable ⇒ Boolean writeonly
Instance Method Summary collapse
- #attached=(bool) ⇒ Object
- #attached? ⇒ Boolean
-
#itemized? ⇒ Boolean
Itemized entities are automatically listed in room descriptions.
- #parent=(new_parent) ⇒ Object
-
#portable? ⇒ Boolean
Portable entities can be taken with TAKE actions.
-
#room ⇒ Room
The entity’s parent room (i.e., the closest ascendant that is a Room).
Instance Attribute Details
#itemized=(value) ⇒ Boolean (writeonly)
3 4 5 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 3 def itemized=(value) @itemized = value end |
#locale_description ⇒ String?
An optional description to use when itemizing entities in room descriptions. The locale_description will be used instead of adding the entity’s name to a list.
13 14 15 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 13 def locale_description @locale_description end |
#portable=(value) ⇒ Boolean (writeonly)
6 7 8 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 6 def portable=(value) @portable = value end |
Instance Method Details
#attached=(bool) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 35 def attached=(bool) @attached = if parent.nil? # @todo Log attachment failure false else bool end end |
#attached? ⇒ Boolean
30 31 32 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 30 def attached? @attached ||= false end |
#itemized? ⇒ Boolean
Itemized entities are automatically listed in room descriptions.
18 19 20 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 18 def itemized? @itemized end |
#parent=(new_parent) ⇒ Object
44 45 46 47 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 44 def parent=(new_parent) self.attached = false unless new_parent == parent super end |
#portable? ⇒ Boolean
Portable entities can be taken with TAKE actions.
25 26 27 |
# File 'lib/gamefic-standard/modules/standardized.rb', line 25 def portable? @portable end |