made store collection routine in SM, and updated everything to suit

This commit is contained in:
Vermilingua
2013-11-01 17:01:21 +11:00
parent a68f58e648
commit d7fc109554
5 changed files with 97 additions and 70 deletions
+35
View File
@@ -190,6 +190,41 @@ var StateManager = {
};
},
getStores: function() {
var stores = [
$SM.get('stores["wood"]'),
$SM.get('stores["fur"]'),
$SM.get('stores["meat"]'),
$SM.get('stores["iron"]'),
$SM.get('stores["coal"]'),
$SM.get('stores["sulphur"]'),
$SM.get('stores["steel"]'),
$SM.get('stores["cured meat"]'),
$SM.get('stores["scales"]'),
$SM.get('stores["teeth"]'),
$SM.get('stores["leather"]'),
$SM.get('stores["bait"]'),
$SM.get('stores["torch"]'),
$SM.get('stores["cloth"]'),
$SM.get('stores["bone spear"]'),
$SM.get('stores["iron sword"]'),
$SM.get('stores["steel sword"]'),
$SM.get('stores["bayonet"]'),
$SM.get('stores["rifle"]'),
$SM.get('stores["laser rifle"]'),
$SM.get('stores["bullets"]'),
$SM.get('stores["energy cell"]'),
$SM.get('stores["grenade"]'),
$SM.get('stores["bolas"]')
];
for (var n = 0; n <= 23; n++) {
if (isNaN(stores[n])) {
stores[n] = 0;
}
}
return stores;
},
//creates full reference from input
//hopefully this won't ever need to be more complicated
buildPath: function(input){