using System.Collections.Generic;
using Content.Server.Body.Systems;
using Content.Shared.Body.Components;
using Content.Shared.Body.Prototypes;
using Content.Shared.FixedPoint;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.Body.Components
{
///
/// Handles metabolizing various reagents with given effects.
///
[RegisterComponent, Friend(typeof(MetabolizerSystem))]
public class MetabolizerComponent : Component
{
public float AccumulatedFrametime = 0.0f;
///
/// How often to metabolize reagents, in seconds.
///
///
[DataField("updateFrequency")]
public float UpdateFrequency = 1.0f;
///
/// From which solution will this metabolizer attempt to metabolize chemicals
///
[DataField("solution")]
public string SolutionName { get; set; } = BloodstreamSystem.DefaultSolutionName;
///
/// Does this component use a solution on it's parent entity (the body) or itself
///
///
/// Most things will use the parent entity (bloodstream).
///
[DataField("solutionOnBody")]
public bool SolutionOnBody = true;
///
/// List of metabolizer types that this organ is. ex. Human, Slime, Felinid, w/e.
///
[DataField("metabolizerTypes", customTypeSerializer:typeof(PrototypeIdHashSetSerializer))]
public HashSet? MetabolizerTypes = null;
///
/// Should this metabolizer remove chemicals that have no metabolisms defined?
/// As a stop-gap, basically.
///
[DataField("removeEmpty")]
public bool RemoveEmpty = false;
///
/// How many reagents can this metabolizer process at once?
/// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low
/// quantity, would be muuuuch better than just one poison acting.
///
[DataField("maxReagents")]
public int MaxReagentsProcessable = 3;
///
/// A list of metabolism groups that this metabolizer will act on, in order of precedence.
///
[DataField("groups")]
public List? MetabolismGroups = default!;
}
///
/// Contains data about how a metabolizer will metabolize a single group.
/// This allows metabolizers to remove certain groups much faster, or not at all.
///
[DataDefinition]
public class MetabolismGroupEntry
{
[DataField("id", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))]
public string Id = default!;
[DataField("rateModifier")]
public FixedPoint2 MetabolismRateModifier = 1.0;
}
}