mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 22:03:56 -07:00
Removes the serialization of JSON files, shrinking savegame files and rejoin states sent across the network, refs #3834, #4239, #3909,f24523dc8f. Removes the AI C++ code to read JSON files frome33d4a52e9since the AI can now use the globalscript. Allows the AI to read Aura templates and removal of GUIInterface code to improve performance. Serialization of the JSON objects in other simulation components was removed in9c0e37f2c0/ D1109,a6f14f5631/ D1130. Serialization removal planned by sanderd17 AI part proofread by mimo Simulation part proofread by bb Discussed with Itms on irc Differential Revision: https://code.wildfiregames.com/D1108 This was SVN commit r20737.
18 lines
1.1 KiB
JavaScript
18 lines
1.1 KiB
JavaScript
Engine.LoadComponentScript("interfaces/TechnologyManager.js");
|
|
Engine.LoadComponentScript("TechnologyManager.js");
|
|
|
|
global.TechnologyTemplates = {
|
|
"GetAll": () => []
|
|
};
|
|
|
|
let cmpTechnologyManager = ConstructComponent(SYSTEM_ENTITY, "TechnologyManager", {});
|
|
|
|
// Test CheckTechnologyRequirements
|
|
let template = { "requirements": { "all": [{ "entity": { "class": "Village", "number": 5 } }, { "civ": "athen" }] } };
|
|
cmpTechnologyManager.classCounts["Village"] = 2;
|
|
TS_ASSERT_EQUALS(cmpTechnologyManager.CheckTechnologyRequirements(DeriveTechnologyRequirements(template, "athen")), false);
|
|
TS_ASSERT_EQUALS(cmpTechnologyManager.CheckTechnologyRequirements(DeriveTechnologyRequirements(template, "athen"), true), true);
|
|
TS_ASSERT_EQUALS(cmpTechnologyManager.CheckTechnologyRequirements(DeriveTechnologyRequirements(template, "maur"), true), false);
|
|
cmpTechnologyManager.classCounts["Village"] = 6;
|
|
TS_ASSERT_EQUALS(cmpTechnologyManager.CheckTechnologyRequirements(DeriveTechnologyRequirements(template, "athen")), true);
|
|
TS_ASSERT_EQUALS(cmpTechnologyManager.CheckTechnologyRequirements(DeriveTechnologyRequirements(template, "maur")), false);
|