Class: Door

Inherits:
Portal show all
Includes:
Lockable, Openable
Defined in:
lib/gamefic-standard/entities/door.rb

Overview

An openable 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_key?, #locked?, #unlocked?

Methods included from Openable

#accessible?, #closed?, #open?

Methods inherited from Portal

#instruction, #name, #reverse, #synonyms

Instance Method Details

#locked=(bool) ⇒ Object



18
19
20
21
# File 'lib/gamefic-standard/entities/door.rb', line 18

def locked= bool
  super
  update_reverse_lock
end

#open=(bool) ⇒ Object



13
14
15
16
# File 'lib/gamefic-standard/entities/door.rb', line 13

def open= bool
  super
  update_reverse_open
end

#post_initializeObject



9
10
11
# File 'lib/gamefic-standard/entities/door.rb', line 9

def post_initialize
  update_reverse_open
end

#two_way_lock_key=(key) ⇒ Object



23
24
25
26
27
# File 'lib/gamefic-standard/entities/door.rb', line 23

def two_way_lock_key= key
  lock_key = key
  return if reverse.nil?
  reverse.lock_key = key
end