Commit ac396253 authored by Matthew Odle's avatar Matthew Odle

add classNames object to stores items; this will be used with the class-names...

add classNames object to stores items; this will be used with the class-names library to show a transition when the value is updated
parent 7174aa2c
......@@ -100,7 +100,10 @@ export class Village extends React.Component {
addProduct = (buildingName, goods) => {
const villageStore = this.state.villageStore;
theGood => villageStore[theGood].count += 1
theGood => {
villageStore[theGood].count += 1;
villageStore[theGood] = true;
// holy crap this is confusing; basically, count the elements in the goods array and stuff them in an object
// then loop through the keys of the object and print the amounts produced
......@@ -57,13 +57,13 @@ const startingLog = [
const villageStore = {
wood: {count: knobsAndLevers.defaultWoodStores, source: 'FORESTER_HUT'},
tool: {count: knobsAndLevers.defaultToolStores, source: 'SMITHY'},
iron: {count: knobsAndLevers.defaultIronStores, source: 'MINE'},
firewood: {count: knobsAndLevers.defaultFirewoodStores, source: 'WOODCUTTER_HUT'},
food: {count: knobsAndLevers.defaultFoodStores, source: 'GATHERER_HUT, HUNTER_LODGE'},
hide: {count: knobsAndLevers.defaultHideStores, source: 'HUNTER_LODGE'},
clothing: {count: knobsAndLevers.defaultClothingStores, source: 'TAILOR'},
wood: {count: knobsAndLevers.defaultWoodStores, source: 'FORESTER_HUT', classNames: {}},
tool: {count: knobsAndLevers.defaultToolStores, source: 'SMITHY', classNames: {}},
iron: {count: knobsAndLevers.defaultIronStores, source: 'MINE', classNames: {}},
firewood: {count: knobsAndLevers.defaultFirewoodStores, source: 'WOODCUTTER_HUT', classNames: {}},
food: {count: knobsAndLevers.defaultFoodStores, source: 'GATHERER_HUT, HUNTER_LODGE', classNames: {}},
hide: {count: knobsAndLevers.defaultHideStores, source: 'HUNTER_LODGE', classNames: {}},
clothing: {count: knobsAndLevers.defaultClothingStores, source: 'TAILOR', classNames: {}},
const addVillager = () => {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment