X-Git-Url: https://git.xangelo.ca/?a=blobdiff_plain;f=src%2Frender%2Fland-development.ts;h=0c1fad915890fe43330a3feb61683a9a6443a117;hb=9c0287740b282030291008cd9cf204c7f1ca8958;hp=18b64a7f5f5a0562e8ed9704fcaa7eaae4152f5f;hpb=516deaa637cb322ddbb4fb9121d56d23fef5d7a8;p=browser-rts.git diff --git a/src/render/land-development.ts b/src/render/land-development.ts index 18b64a7..0c1fad9 100644 --- a/src/render/land-development.ts +++ b/src/render/land-development.ts @@ -1,27 +1,29 @@ import { BuildQueue } from "../repository/build-queue"; -import { City } from "../repository/city"; +import { CityWithLocation } from "../repository/city"; import { Building } from '../repository/buildings'; import _ from "lodash"; function progressBar(current, max): string { const percent = Math.ceil((current/max) * 100); return ` -
+
${percent}%
`; } -export function renderLandDevelopment(city: City, buildings: Building[], buildQueues: BuildQueue[]): string { +export function renderLandDevelopment(city: CityWithLocation, buildings: Building[], buildQueues: BuildQueue[]): string { const freeSpace = city.totalSpace - city.usedSpace; let html = ` -
+
+

Construction

- + - + + ${ buildings.map(building => { @@ -31,12 +33,12 @@ export function renderLandDevelopment(city: City, buildings: Building[], buildQu + `; }).join("\n") @@ -48,14 +50,13 @@ export function renderLandDevelopment(city: City, buildings: Building[], buildQu const queues = `
-

Build Queues

+

Build Queues

Free LandType Current${(city.totalSpace - city.usedSpace).toLocaleString()} (${Math.ceil(freeSpace/city.totalSpace * 100)}% available)Space Available: ${(city.totalSpace - city.usedSpace).toLocaleString()} (${Math.ceil(freeSpace/city.totalSpace * 100)}% available)Cost
${city[building.slug]}
- +
-
- ${buildQueues.sort((a, b) => { return a.due - b.due; }).map(queue => { @@ -73,6 +74,5 @@ export function renderLandDevelopment(city: City, buildings: Building[], buildQu
Building Amount Expected Progress
`; - return html + queues; -} \ No newline at end of file +}