Skip to content
Snippets Groups Projects
loadToCurrencyConverterService.ts 471 B
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
    import { FluidType } from 'enum/fluid.enum'
    import Config from '../../config.json'
    import IFluidConfig from './IFluidConfig'
    
    export default class LoadToCurrencyConverter {
      private readonly _fluidConfig: IFluidConfig[]
    
      constructor() {
        this._fluidConfig = Config.fluidConfig
      }
    
      public Convert(load: number, fluidType: FluidType): number {
        const convertedLoad: number =
          load * this._fluidConfig[fluidType].coefficient
    
        return convertedLoad
      }
    }