Differential D2426 Diff 12460 binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | |||||
AddMock(SYSTEM_ENTITY, IID_EndGameManager, { | AddMock(SYSTEM_ENTITY, IID_EndGameManager, { | ||||
"GetVictoryConditions": () => ["conquest", "wonder"], | "GetVictoryConditions": () => ["conquest", "wonder"], | ||||
"GetAlliedVictory": function() { return false; } | "GetAlliedVictory": function() { return false; } | ||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | ||||
"GetNumPlayers": function() { return 2; }, | "GetNumPlayers": function() { return 2; }, | ||||
"GetPlayerByID": function(id) { TS_ASSERT(id === 0 || id === 1); return 100 + id; } | "GetPlayerByID": function(id) { TS_ASSERT(id === 0 || id === 1); return 100 + id; }, | ||||
"GetMaxWorldPopulation": function() {} | |||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_RangeManager, { | AddMock(SYSTEM_ENTITY, IID_RangeManager, { | ||||
"GetLosVisibility": function(ent, player) { return "visible"; }, | "GetLosVisibility": function(ent, player) { return "visible"; }, | ||||
"GetLosCircular": function() { return false; } | "GetLosCircular": function() { return false; } | ||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | ||||
▲ Show 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | "players": [ | ||||
}, | }, | ||||
"percentMapExplored": 10 | "percentMapExplored": 10 | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
"circularMap": false, | "circularMap": false, | ||||
"timeElapsed": 0, | "timeElapsed": 0, | ||||
"victoryConditions": ["conquest", "wonder"], | "victoryConditions": ["conquest", "wonder"], | ||||
"alliedVictory": false | "alliedVictory": false, | ||||
"maxWorldPopulation": undefined | |||||
}); | }); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedSimulationState(), { | TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedSimulationState(), { | ||||
"players": [ | "players": [ | ||||
{ | { | ||||
"name": "Player 1", | "name": "Player 1", | ||||
"civ": "gaia", | "civ": "gaia", | ||||
"color": { "r": 1, "g": 1, "b": 1, "a": 1 }, | "color": { "r": 1, "g": 1, "b": 1, "a": 1 }, | ||||
▲ Show 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | "players": [ | ||||
"peakPercentOfMapControlled": [0, 10], | "peakPercentOfMapControlled": [0, 10], | ||||
"teamPeakPercentOfMapControlled": [0, 10] | "teamPeakPercentOfMapControlled": [0, 10] | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
"circularMap": false, | "circularMap": false, | ||||
"timeElapsed": 0, | "timeElapsed": 0, | ||||
"victoryConditions": ["conquest", "wonder"], | "victoryConditions": ["conquest", "wonder"], | ||||
"alliedVictory": false | "alliedVictory": false, | ||||
"maxWorldPopulation": undefined | |||||
}); | }); | ||||
AddMock(10, IID_Builder, { | AddMock(10, IID_Builder, { | ||||
"GetEntitiesList": function() { | "GetEntitiesList": function() { | ||||
return ["test1", "test2"]; | return ["test1", "test2"]; | ||||
}, | }, | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator