Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/DataTemplateManager.js
Show All 19 Lines | DataTemplateManager.prototype.Init = function() | ||||
deepfreeze(this.allTechs); | deepfreeze(this.allTechs); | ||||
deepfreeze(this.allAuras); | deepfreeze(this.allAuras); | ||||
}; | }; | ||||
DataTemplateManager.prototype.GetTechnologyTemplate = function(template) | DataTemplateManager.prototype.GetTechnologyTemplate = function(template) | ||||
{ | { | ||||
if (!this.allTechs[template]) | if (!this.allTechs[template]) | ||||
{ | { | ||||
this.allTechs[template] = Engine.ReadJSONFile("technologies/" + template + ".json"); | this.allTechs[template] = Engine.ReadJSONFile("simulation/data/technologies/" + template + ".json"); | ||||
if (!this.allTechs[template]) | if (!this.allTechs[template]) | ||||
error("Failed to load technology \"" + template + "\""); | error("Failed to load technology \"" + template + "\""); | ||||
} | } | ||||
return this.allTechs[template]; | return this.allTechs[template]; | ||||
}; | }; | ||||
DataTemplateManager.prototype.GetAuraTemplate = function(template) | DataTemplateManager.prototype.GetAuraTemplate = function(template) | ||||
{ | { | ||||
if (!this.allAuras[template]) | if (!this.allAuras[template]) | ||||
{ | { | ||||
this.allAuras[template] = Engine.ReadJSONFile("auras/" + template + ".json"); | this.allAuras[template] = Engine.ReadJSONFile("simulation/data/auras/" + template + ".json"); | ||||
if (!this.allAuras[template]) | if (!this.allAuras[template]) | ||||
error("Failed to load aura \"" + template + "\""); | error("Failed to load aura \"" + template + "\""); | ||||
} | } | ||||
return this.allAuras[template]; | return this.allAuras[template]; | ||||
}; | }; | ||||
DataTemplateManager.prototype.ListAllTechs = function() | DataTemplateManager.prototype.ListAllTechs = function() | ||||
Show All 20 Lines |
Wildfire Games · Phabricator