Module: Shop

Defined in:
lib/Olib/shops.rb

Defined Under Namespace

Classes: Container, Playershop

Constant Summary collapse

@@containers =
[]

Class Method Summary collapse

Class Method Details

.cacheObject



26
27
28
# File 'lib/Olib/shops.rb', line 26

def Shop.cache
  @@containers
end

.containersObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/Olib/shops.rb', line 11

def Shop.containers
  #fput "look"
  @@containers = [
    GameObj.loot, 
    GameObj.room_desc
  ]
  .flatten
  .compact
  .select     { |container| !(container.name =~ /^([A-z][a-z]+ disk$)/)}
  .map        { |container| Shop::Container.new(container)  }

  @@containers

end

.itemsObject



7
8
9
# File 'lib/Olib/shops.rb', line 7

def Shop.items
  Shop.containers.map { |container| container.contents }.flatten
end