Class: Gamefic::Standard::Door
- Defined in:
- lib/gamefic/standard/entities/door.rb
Overview
An openable and lockable portal.
Instance Attribute Summary
Attributes included from Lockable
Attributes inherited from Portal
Attributes included from Standardized
#itemized, #locale_description, #portable
Instance Method Summary collapse
- #locked=(bool) ⇒ Object
- #open=(bool) ⇒ Object
- #post_initialize ⇒ Object
- #two_way_lock_key=(key) ⇒ Object
- #type_name ⇒ Object
Methods included from Lockable
#lock, #lock_key?, #locked?, #unlock, #unlocked?
Methods included from Openable
#accessible, #close, #closed?, #open, #open?
Methods inherited from Portal
#instruction, #name, #reverse, #synonyms
Methods included from Standardized
#attached=, #attached?, #itemized?, #parent=, #portable?, #room
Instance Method Details
#locked=(bool) ⇒ Object
23 24 25 26 |
# File 'lib/gamefic/standard/entities/door.rb', line 23 def locked=(bool) super update_reverse_lock end |
#open=(bool) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/gamefic/standard/entities/door.rb', line 16 def open=(bool) super reverse&.lock_key = lock_key update_reverse_open update_reverse_lock end |
#post_initialize ⇒ Object
11 12 13 14 |
# File 'lib/gamefic/standard/entities/door.rb', line 11 def post_initialize update_reverse_open update_reverse_lock end |
#two_way_lock_key=(key) ⇒ Object
28 29 30 31 |
# File 'lib/gamefic/standard/entities/door.rb', line 28 def two_way_lock_key=(key) self.lock_key = key reverse&.lock_key = key end |
#type_name ⇒ Object
33 34 35 |
# File 'lib/gamefic/standard/entities/door.rb', line 33 def type_name @type_name ||= 'door' end |