Module: Olib::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


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

def Shop.cache
  @@containers
end

.containersObject


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

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


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

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