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



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

def locked= bool
  super
  update_reverse_lock
end

#open=(bool) ⇒ Object



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

def open= bool
  super
  update_reverse_open
end

#post_initializeObject



7
8
9
# File 'lib/gamefic-standard/entities/door.rb', line 7

def post_initialize
  update_reverse_open
end

#two_way_lock_key=(key) ⇒ Object



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

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