Character customization, fixed progress bar, updated number formatting and time formatting
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user