Class: Door
- Defined in:
- lib/gamefic-standard/entities/door.rb
Overview
An openable and lockable portal.
Instance Attribute Summary
Attributes included from Gamefic::Standard::Lockable
Attributes inherited from Portal
Instance Method Summary collapse
- #locked=(bool) ⇒ Object
- #open=(bool) ⇒ Object
- #post_initialize ⇒ Object
- #two_way_lock_key=(key) ⇒ Object
Methods included from Gamefic::Standard::Lockable
#lock_key?, #locked?, #unlocked?
Methods included from Gamefic::Standard::Openable
#accessible?, #close, #closed?, #open, #open?
Methods inherited from Portal
#instruction, #name, #reverse, #synonyms
Instance Method Details
#locked=(bool) ⇒ Object
21 22 23 24 |
# File 'lib/gamefic-standard/entities/door.rb', line 21 def locked=(bool) super update_reverse_lock end |
#open=(bool) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/gamefic-standard/entities/door.rb', line 14 def open=(bool) super reverse&.lock_key = lock_key update_reverse_open update_reverse_lock end |
#post_initialize ⇒ Object
9 10 11 12 |
# File 'lib/gamefic-standard/entities/door.rb', line 9 def post_initialize update_reverse_open update_reverse_lock end |
#two_way_lock_key=(key) ⇒ Object
26 27 28 29 |
# File 'lib/gamefic-standard/entities/door.rb', line 26 def two_way_lock_key=(key) self.lock_key = key reverse&.lock_key = key end |