Class: Gamefic::Standard::Door
Overview
An openable and lockable portal.
Instance Attribute Summary
Attributes included from Lockable
#lock_key
Attributes inherited from Portal
#destination, #direction
Instance Method Summary
collapse
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
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
|