Class: Room

Inherits:
Thing
  • Object
show all
Defined in:
lib/gamefic-standard/entities/room.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#explicit_exits=(value) ⇒ Object (writeonly)

Sets the attribute explicit_exits

Parameters:

  • value

    the value to set the attribute explicit_exits to.



2
3
4
# File 'lib/gamefic-standard/entities/room.rb', line 2

def explicit_exits=(value)
  @explicit_exits = value
end

Class Method Details

.explicit_exits=(bool) ⇒ Object



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

def explicit_exits=(bool)
  set_default explicit_exits: bool
end

.explicit_exits?Boolean

Returns:

  • (Boolean)


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

def explicit_exits?
  default_attributes[:explicit_exits]
end

Instance Method Details

#explicit_exits?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/gamefic-standard/entities/room.rb', line 6

def explicit_exits?
  @explicit_exits
end

#find_portal(direction) ⇒ Object



14
15
16
17
18
# File 'lib/gamefic-standard/entities/room.rb', line 14

def find_portal(direction)
  d = direction.to_s
  portals = children.that_are(Portal).delete_if { |p| p.direction.to_s != d }
  portals[0]
end

#tell(message) ⇒ Object



10
11
12
# File 'lib/gamefic-standard/entities/room.rb', line 10

def tell(message)
  children.each { |c| c.tell message }
end