From 41138b54b68f8cdebef7eb13c02bc6aafab9d8ca Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Tue, 27 Dec 2022 20:12:17 -0600 Subject: [PATCH] Load new-style stock files --- src/lib/data/gold.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/data/gold.rb b/src/lib/data/gold.rb index febeff2..b98f9dd 100644 --- a/src/lib/data/gold.rb +++ b/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 \ No newline at end of file +end