Module: Gamefic::Standard::Standardized
- Defined in:
- lib/gamefic/standard/standardized.rb
Overview
Common features of standard entities.
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)
9 10 11 |
# File 'lib/gamefic/standard/standardized.rb', line 9 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.
19 20 21 |
# File 'lib/gamefic/standard/standardized.rb', line 19 def locale_description @locale_description end |
#portable=(value) ⇒ Boolean (writeonly)
12 13 14 |
# File 'lib/gamefic/standard/standardized.rb', line 12 def portable=(value) @portable = value end |
Instance Method Details
#attached=(bool) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/gamefic/standard/standardized.rb', line 41 def attached=(bool) @attached = if parent.nil? # @todo Log attachment failure false else bool end end |
#attached? ⇒ Boolean
36 37 38 |
# File 'lib/gamefic/standard/standardized.rb', line 36 def attached? @attached ||= false end |
#itemized? ⇒ Boolean
Itemized entities are automatically listed in room descriptions.
24 25 26 |
# File 'lib/gamefic/standard/standardized.rb', line 24 def itemized? @itemized end |
#parent=(new_parent) ⇒ Object
50 51 52 53 |
# File 'lib/gamefic/standard/standardized.rb', line 50 def parent=(new_parent) self.attached = false unless new_parent == parent super end |
#portable? ⇒ Boolean
Portable entities can be taken with TAKE actions.
31 32 33 |
# File 'lib/gamefic/standard/standardized.rb', line 31 def portable? @portable end |