Differential D88 Diff 685 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 52 Lines • ▼ Show 20 Lines | |||||
AddMock(SYSTEM_ENTITY, IID_Barter, { | AddMock(SYSTEM_ENTITY, IID_Barter, { | ||||
GetPrices: function() { | GetPrices: function() { | ||||
return { | return { | ||||
"buy": { "food": 150 }, | "buy": { "food": 150 }, | ||||
"sell": { "food": 25 } | "sell": { "food": 25 } | ||||
}; | }; | ||||
} | }, | ||||
PlayerHasMarket: function () { return false; } | |||||
bb: could become arrow function, but seeing surrounding code: mehh | |||||
Not Done Inline ActionsIt indeed could, but I'll leave it as-is to maintain consistency with the style of the rest of the file. s0600204: It indeed could, but I'll leave it as-is to maintain consistency with the style of the rest of… | |||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_EndGameManager, { | AddMock(SYSTEM_ENTITY, IID_EndGameManager, { | ||||
GetGameType: function() { return "conquest"; }, | GetGameType: function() { return "conquest"; }, | ||||
GetAlliedVictory: function() { return false; } | GetAlliedVictory: function() { return false; } | ||||
}); | }); | ||||
AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | players: [ | ||||
entityLimits: {"Foo": 10}, | entityLimits: {"Foo": 10}, | ||||
entityCounts: {"Foo": 5}, | entityCounts: {"Foo": 5}, | ||||
entityLimitChangers: {"Foo": {}}, | entityLimitChangers: {"Foo": {}}, | ||||
researchQueued: {}, | researchQueued: {}, | ||||
researchStarted: {}, | researchStarted: {}, | ||||
researchedTechs: {}, | researchedTechs: {}, | ||||
classCounts: {}, | classCounts: {}, | ||||
typeCountsByClass: {}, | typeCountsByClass: {}, | ||||
canBarter: false, | |||||
statistics: { | statistics: { | ||||
resourcesGathered: { | resourcesGathered: { | ||||
food: 100, | food: 100, | ||||
wood: 0, | wood: 0, | ||||
metal: 0, | metal: 0, | ||||
stone: 0, | stone: 0, | ||||
vegetarianFood: 0, | vegetarianFood: 0, | ||||
}, | }, | ||||
Show All 26 Lines | players: [ | ||||
entityLimits: {"Bar": 20}, | entityLimits: {"Bar": 20}, | ||||
entityCounts: {"Bar": 0}, | entityCounts: {"Bar": 0}, | ||||
entityLimitChangers: {"Bar": {}}, | entityLimitChangers: {"Bar": {}}, | ||||
researchQueued: {}, | researchQueued: {}, | ||||
researchStarted: {}, | researchStarted: {}, | ||||
researchedTechs: {}, | researchedTechs: {}, | ||||
classCounts: {}, | classCounts: {}, | ||||
typeCountsByClass: {}, | typeCountsByClass: {}, | ||||
canBarter: false, | |||||
statistics: { | statistics: { | ||||
resourcesGathered: { | resourcesGathered: { | ||||
food: 100, | food: 100, | ||||
wood: 0, | wood: 0, | ||||
metal: 0, | metal: 0, | ||||
stone: 0, | stone: 0, | ||||
vegetarianFood: 0, | vegetarianFood: 0, | ||||
}, | }, | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | players: [ | ||||
entityLimits: {"Foo": 10}, | entityLimits: {"Foo": 10}, | ||||
entityCounts: {"Foo": 5}, | entityCounts: {"Foo": 5}, | ||||
entityLimitChangers: {"Foo": {}}, | entityLimitChangers: {"Foo": {}}, | ||||
researchQueued: {}, | researchQueued: {}, | ||||
researchStarted: {}, | researchStarted: {}, | ||||
researchedTechs: {}, | researchedTechs: {}, | ||||
classCounts: {}, | classCounts: {}, | ||||
typeCountsByClass: {}, | typeCountsByClass: {}, | ||||
canBarter: false, | |||||
statistics: { | statistics: { | ||||
unitsTrained: 10, | unitsTrained: 10, | ||||
unitsLost: 9, | unitsLost: 9, | ||||
buildingsConstructed: 5, | buildingsConstructed: 5, | ||||
buildingsCaptured: 7, | buildingsCaptured: 7, | ||||
buildingsLost: 4, | buildingsLost: 4, | ||||
civCentresBuilt: 1, | civCentresBuilt: 1, | ||||
resourcesGathered: { | resourcesGathered: { | ||||
Show All 39 Lines | players: [ | ||||
entityLimits: {"Bar": 20}, | entityLimits: {"Bar": 20}, | ||||
entityCounts: {"Bar": 0}, | entityCounts: {"Bar": 0}, | ||||
entityLimitChangers: {"Bar": {}}, | entityLimitChangers: {"Bar": {}}, | ||||
researchQueued: {}, | researchQueued: {}, | ||||
researchStarted: {}, | researchStarted: {}, | ||||
researchedTechs: {}, | researchedTechs: {}, | ||||
classCounts: {}, | classCounts: {}, | ||||
typeCountsByClass: {}, | typeCountsByClass: {}, | ||||
canBarter: false, | |||||
statistics: { | statistics: { | ||||
unitsTrained: 10, | unitsTrained: 10, | ||||
unitsLost: 9, | unitsLost: 9, | ||||
buildingsConstructed: 5, | buildingsConstructed: 5, | ||||
buildingsCaptured: 7, | buildingsCaptured: 7, | ||||
buildingsLost: 4, | buildingsLost: 4, | ||||
civCentresBuilt: 1, | civCentresBuilt: 1, | ||||
resourcesGathered: { | resourcesGathered: { | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | TS_ASSERT_UNEVAL_EQUALS(cmp.GetEntityState(-1, 10), { | ||||
needsRepair: false, | needsRepair: false, | ||||
needsHeal: true, | needsHeal: true, | ||||
canDelete: true, | canDelete: true, | ||||
}); | }); | ||||
TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedEntityState(-1, 10), { | TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedEntityState(-1, 10), { | ||||
armour: null, | armour: null, | ||||
attack: null, | attack: null, | ||||
barterMarket: { | |||||
prices: { "buy": {"food":150}, "sell": {"food":25} }, | |||||
}, | |||||
buildingAI: null, | buildingAI: null, | ||||
heal: null, | heal: null, | ||||
isBarterMarket: true, | |||||
loot: null, | loot: null, | ||||
obstruction: null, | obstruction: null, | ||||
turretParent: null, | turretParent: null, | ||||
promotion: null, | promotion: null, | ||||
repairRate: null, | repairRate: null, | ||||
buildRate: null, | buildRate: null, | ||||
resourceDropsite: null, | resourceDropsite: null, | ||||
resourceGatherRates: null, | resourceGatherRates: null, | ||||
resourceSupply: null, | resourceSupply: null, | ||||
speed: null, | speed: null, | ||||
}); | }); |
Wildfire Games · Phabricator
could become arrow function, but seeing surrounding code: mehh