Character customization, fixed progress bar, updated number formatting and time formatting

This commit is contained in:
2023-02-04 13:37:20 +02:00
parent 2a38098d1c
commit 4a625f83a3
26 changed files with 353 additions and 33 deletions

View File

@@ -2,6 +2,7 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {PlantDto} from "../plant.dto";
import {PlayerService} from "../player.service";
import Plant from "../Plant";
import {UtilitiesService} from "../utilities.service";
@Component({
selector: 'app-farmer-container',
@@ -11,12 +12,18 @@ import Plant from "../Plant";
export class FarmerContainerComponent implements OnInit {
@Input('plant') plant!: Plant;
constructor(private playerService: PlayerService) { }
constructor(
private playerService: PlayerService,
private utilitiesService: UtilitiesService,
) { }
getPrice() {
if (!this.plant) return 0;
return this.plant.getPlantData().farmer.price;
}
getPriceFormatted() {
return this.utilitiesService.formatNumber(this.getPrice());
}
buy() {
this.playerService.buyFarmer(this.plant.id);
}