2020-03-14 14:04:08 +01:00
|
|
|
|
using Content.Shared.Interfaces.Chemistry;
|
2019-11-21 17:24:19 -05:00
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Interfaces.Serialization;
|
2020-03-14 14:04:08 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
2019-11-21 17:24:19 -05:00
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Chemistry
|
|
|
|
|
|
{
|
|
|
|
|
|
//Default metabolism for reagents. Metabolizes the reagent with no effects
|
|
|
|
|
|
class DefaultMetabolizable : IMetabolizable
|
|
|
|
|
|
{
|
|
|
|
|
|
//Rate of metabolism in units / second
|
2020-03-14 12:55:07 +01:00
|
|
|
|
private decimal _metabolismRate = 1;
|
|
|
|
|
|
public decimal MetabolismRate => _metabolismRate;
|
2019-11-21 17:24:19 -05:00
|
|
|
|
|
|
|
|
|
|
void IExposeData.ExposeData(ObjectSerializer serializer)
|
|
|
|
|
|
{
|
|
|
|
|
|
serializer.DataField(ref _metabolismRate, "rate", 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-05 11:36:12 +02:00
|
|
|
|
ReagentUnit IMetabolizable.Metabolize(IEntity solutionEntity, string reagentId, float tickTime)
|
2019-11-21 17:24:19 -05:00
|
|
|
|
{
|
2020-04-05 11:36:12 +02:00
|
|
|
|
return ReagentUnit.New(MetabolismRate * (decimal)tickTime);
|
2019-11-21 17:24:19 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|