import { Account } from "../repository/accounts";
-import { CityWithLocation } from "../repository/city";
+import { CityWithLocation, CityRepository } from "../repository/city";
import * as _ from 'lodash';
type Usage = {
energyProductionPerTick: number;
}
+const cityRepo = new CityRepository();
+
export function renderKingomOverview(city: CityWithLocation & Usage, account: Account): string {
const foodRateOfChange = city.foodProductionPerTick - city.foodUsagePerTick;
const energyRateOfChange = city.energyProductionPerTick - city.energyUsagePerTick;
<th>Captain</th>
<td>${account.username}</td>
<th>Population</th>
- <td>${city.population.toLocaleString()}/${_.max([city.farms * 70, city.population])}</td>
+ <td>${city.population.toLocaleString()}/${cityRepo.maxPopulation(city)}</td>
</tr>
<tr>
<th>Space</th>