Load new-style stock files

pull/8/head
Daniel Asher Resnick 2 years ago
parent 9d3c8b8870
commit c7a3335bec
  1. 10
      src/lib/data/gold.rb

@ -1,4 +1,5 @@
require 'json'
require_relative '../stock'
module Charred
module Gold
@ -12,6 +13,7 @@ module Charred
lifepaths = {}
resources = {}
stat_pts = {}
stock_objs = {}
stocks = ['dwarf', 'elf', 'man', 'orc', 'roden', 'wolf']
@ -24,6 +26,9 @@ module Charred
file = File.read("data/gold/starting_stat_pts/#{stock}.json")
stat_pts[stock] = JSON.parse(file)
file = File.read("data/gold/stocks/#{stock}.json")
stock_objs[stock] = Stock.new(JSON.parse(file))
end
data.merge!({
@ -32,8 +37,9 @@ module Charred
:traits => traits,
:lifepaths => lifepaths,
:resources => resources,
:stat_pts => stat_pts
:stat_pts => stat_pts,
:stock_objs => stock_objs
})
end
end
end
end

Loading…
Cancel
Save