Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/TechnologyManager.js
Show All 25 Lines | TechnologyManager.prototype.Init = function() | ||||
// Maps from technolgy name to the entityID of the researcher. | // Maps from technolgy name to the entityID of the researcher. | ||||
this.researchQueued = new Map(); | this.researchQueued = new Map(); | ||||
// Holds technologies which are being researched currently (non-queued). | // Holds technologies which are being researched currently (non-queued). | ||||
this.researchStarted = new Set(); | this.researchStarted = new Set(); | ||||
// This stores the modifications to unit stats from researched technologies | // This stores the modifications to unit stats from researched technologies | ||||
// Example data: {"ResourceGatherer/Rates/food.grain": [ | // Example data: {"ResourceGatherer/Rates/food.grain": [ | ||||
// {"multiply": 1.15, "affects": ["FemaleCitizen", "Infantry Sword"]}, | // {"multiply": 1.15, "affects": ["FemaleCitizen", "Infantry Swordsman"]}, | ||||
// {"add": 2} | // {"add": 2} | ||||
// ]} | // ]} | ||||
this.modifications = {}; | this.modifications = {}; | ||||
this.modificationCache = {}; // Caches the values after technologies have been applied | this.modificationCache = {}; // Caches the values after technologies have been applied | ||||
// e.g. { "Attack/Melee/Hack" : {5: {"origValue": 8, "newValue": 10}, 7: {"origValue": 9, "newValue": 12}, ...}, ...} | // e.g. { "Attack/Melee/Hack" : {5: {"origValue": 8, "newValue": 10}, 7: {"origValue": 9, "newValue": 12}, ...}, ...} | ||||
// where 5 and 7 are entity id's | // where 5 and 7 are entity id's | ||||
this.classCounts = {}; // stores the number of entities of each Class | this.classCounts = {}; // stores the number of entities of each Class | ||||
▲ Show 20 Lines • Show All 439 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator