import { Component , OnInit } from '@angular/core' ; import { ConfigurationService } from "../../../../services/configuration.service" ; import { MAXIMUM_STAT_MOD_AMOUNT } from "../../../../data/constants" ; @ Component ( { selector : 'app-desired-mod-selection' , templateUrl : './desired-mod-limit-selection.component.html' , styleUrls : [ './desired-mod-limit-selection.component.scss' ] } ) export class DesiredModLimitSelectionComponent implements OnInit { readonly ModRange = new Array ( MAXIMUM_STAT_MOD_AMOUNT + 1 ) ; selection : number = MAXIMUM_STAT_MOD_AMOUNT ; constructor ( public config ) { } ngOnInit ( ) { this . config . configuration . subscribe ( c => this . selection = c . maximumStatMods ) ; } setValue ( i ) { this . selection = i ; this . config . modifyConfiguration ( c => c . maximumStatMods = i ) ; } }