Replaced static Rounders with an impleneted interface
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using Content.Shared.Interfaces.Chemistry;
|
||||
using Content.Shared.Maths;
|
||||
using Content.Shared.Interfaces.Chemistry;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Serialization;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Chemistry
|
||||
@@ -10,6 +9,9 @@ namespace Content.Shared.Chemistry
|
||||
//Default metabolism for reagents. Metabolizes the reagent with no effects
|
||||
class DefaultMetabolizable : IMetabolizable
|
||||
{
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IRounderForReagents _rounder;
|
||||
#pragma warning restore 649
|
||||
//Rate of metabolism in units / second
|
||||
private decimal _metabolismRate = 1;
|
||||
public decimal MetabolismRate => _metabolismRate;
|
||||
@@ -21,7 +23,7 @@ namespace Content.Shared.Chemistry
|
||||
|
||||
decimal IMetabolizable.Metabolize(IEntity solutionEntity, string reagentId, float tickTime)
|
||||
{
|
||||
var metabolismAmount = (MetabolismRate * (decimal)tickTime).RoundForReagents();
|
||||
var metabolismAmount = _rounder.Round(MetabolismRate * (decimal)tickTime);
|
||||
return metabolismAmount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user