Add next task balance

This commit is contained in:
Anton Vakhrushev 2020-05-27 09:53:14 +03:00
parent 9c6c1243cf
commit c1c832c21c
2 changed files with 13 additions and 0 deletions

View File

@ -111,6 +111,14 @@
<td></td>
</tr>
<resource-line
v-if="villageState.required.active"
:title="'Баланс след.:'"
:hint="'Баланс следующей задачи'"
:resources="villageState.required.balance"
:time1="renderGatheringTime(villageState.required.time)"
/>
<resource-line
v-for="queueState of villageState.queues"
v-bind:key="villageState.id + queueState.queue"

View File

@ -34,6 +34,10 @@ interface ResourceLineState {
* Time to gather all type of resources (slowest time)
*/
time: GatheringTime;
/**
* Is active - resources not equals to zero.
*/
active: boolean;
}
interface VillageProductionQueueState {
@ -99,6 +103,7 @@ function calcResourceBalance(
resources,
balance: current.sub(resources),
time: timeToAllResources(current, resources, performance),
active: !resources.empty(),
};
}