Remove now-redundant stocks key in the data object

pull/8/head
Daniel Asher Resnick 2 years ago
parent e1b52b08f5
commit 897b9ca58c
  1. 6
      src/app.rb
  2. 1
      src/lib/data/gold.rb
  3. 2
      src/lib/data/troll.rb

@ -54,7 +54,7 @@ get '/stock_objs' do
end
get '/lifepaths/:stock' do
if DATA[:stocks].include? params['stock']
if DATA[:stock_objs].keys.include? params['stock']
json DATA[:lifepaths][params['stock']]
else
404
@ -62,7 +62,7 @@ get '/lifepaths/:stock' do
end
get '/starting_stat_pts/:stock' do
if DATA[:stocks].include? params['stock']
if DATA[:stock_objs].keys.include? params['stock']
json DATA[:stat_pts][params['stock']]
else
404
@ -70,7 +70,7 @@ get '/starting_stat_pts/:stock' do
end
get '/resources/:stock' do
if DATA[:stocks].include? params['stock']
if DATA[:stock_objs].keys.include? params['stock']
json DATA[:resources][params['stock']]
else
404

@ -29,7 +29,6 @@ module Charred
end
data.merge!({
:stocks => stocks,
:skills => skills,
:traits => traits,
:lifepaths => lifepaths,

@ -4,8 +4,6 @@ require_relative '../stock'
module Charred
module Troll
def load_troll(data)
data[:stocks] << 'troll'
file = File.read('data/troll/skills.json')
skills = JSON.parse(file)
verbose_merge data[:skills], skills

Loading…
Cancel
Save