1 import { Account } from "../repository/accounts";
2 import { City } from "../repository/city";
3 import * as _ from 'lodash';
5 export function renderKingomOverview(city: City, account: Account): string {
6 return `<div hx-trigger="reload-construction-queue from:body, reload-unit-training from:body, every 600s" hx-get="/poll/overview">
10 <td>${account.username}</td>
12 <td>${city.population.toLocaleString()}/${_.max([city.farms * 70, city.population])}</td>
16 <td>${city.totalSpace.toLocaleString()} (${Math.ceil(city.usedSpace/city.totalSpace * 100)}% used)</td>
18 <td>${city.soldiers.toLocaleString()}</td>
22 <td>${city.location_x},${city.location_y}</td>
24 <td>${city.attackers.toLocaleString()}</td>
28 <td>${city.gold.toLocaleString()}</td>
30 <td>${city.defenders.toLocaleString()}</td>
34 <td>${city.ore.toLocaleString()}</td>
35 <th>Special Attackers</th>
36 <td>${city.sp_attackers.toLocaleString()}</td>
40 <td>${city.logs.toLocaleString()}</td>
41 <th>Special Defenders</th>
42 <td>${city.sp_defenders.toLocaleString()}</td>
46 <td>${city.bushels.toLocaleString()}</td>