diff --git a/src/DashboardView/VillageStateList.vue b/src/DashboardView/VillageStateList.vue index d3f6563..c69316a 100644 --- a/src/DashboardView/VillageStateList.vue +++ b/src/DashboardView/VillageStateList.vue @@ -177,9 +177,10 @@ $->{{ s.village.name }} acc.add(t.args.resources!), Resources.zero()); } - getResourceCommitments(villageId: number): Array { + getResourceShipmentVillageIds(villageId: number): Array { const tasks = this.taskQueue .seeItems() .filter(t => t.name === SendResourcesTask.name && t.args.villageId === villageId && t.args.targetVillageId); diff --git a/src/VillageState.ts b/src/VillageState.ts index 6f7e96c..93ff4ae 100644 --- a/src/VillageState.ts +++ b/src/VillageState.ts @@ -28,6 +28,7 @@ interface VillageOwnStateDictionary { export interface VillageState extends VillageOwnState { commitments: Resources; + shipment: Array; } function calcResourceBalance(resources: Resources, current: Resources, performance: Resources): RequiredResources { @@ -86,13 +87,13 @@ function createVillageState( ownStates: VillageOwnStateDictionary, scheduler: Scheduler ): VillageState { - const villageIds = scheduler.getResourceCommitments(state.id); + const villageIds = scheduler.getResourceShipmentVillageIds(state.id); const commitments = villageIds.reduce((res, villageId) => { const villageRequired = ownStates[villageId].required; const missing = villageRequired.balance.min(Resources.zero()); return res.add(missing); }, Resources.zero()); - return { ...state, commitments }; + return { ...state, commitments, shipment: villageIds }; } export function createVillageStates(villages: Array, scheduler: Scheduler): Array {