using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Robust.Shared.Enums;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Shared.Humanoid;
[RegisterComponent, NetworkedComponent]
public sealed class HumanoidComponent : Component
{
///
/// Current species. Dictates things like base body sprites,
/// base humanoid to spawn, etc.
///
[DataField("species", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string Species { get; set; } = string.Empty;
///
/// The initial profile and base layers to apply to this humanoid.
///
[DataField("initial", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string? Initial { get; }
///
/// Skin color of this humanoid.
///
[DataField("skinColor")]
public Color SkinColor { get; set; } = Color.FromHex("#C0967F");
///
/// Visual layers currently hidden. This will affect the base sprite
/// on this humanoid layer, and any markings that sit above it.
///
[ViewVariables] public readonly HashSet HiddenLayers = new();
[DataField("sex")] public Sex Sex = Sex.Male;
public MarkingSet CurrentMarkings = new();
///
/// Any custom base layers this humanoid might have. See:
/// limb transplants (potentially), robotic arms, etc.
/// Stored on the server, this is merged in the client into
/// all layer settings.
///
[ViewVariables(VVAccess.ReadOnly)]
public Dictionary CustomBaseLayers = new();
public HashSet PermanentlyHidden = new();
public HashSet AllHiddenLayers
{
get
{
var result = new HashSet(HiddenLayers);
result.UnionWith(PermanentlyHidden);
return result;
}
}
// Couldn't these be somewhere else?
[ViewVariables] public Gender Gender = default!;
[ViewVariables] public int Age = 18;
[ViewVariables] public List CurrentClientMarkings = new();
public Dictionary BaseLayers = new();
public string LastSpecies = default!;
}
[DataDefinition]
[Serializable, NetSerializable]
public sealed class CustomBaseLayerInfo
{
public CustomBaseLayerInfo(string id, Color color)
{
ID = id;
Color = color;
}
///
/// ID of this custom base layer. Must be a .
///
[DataField("id")]
public string ID { get; }
///
/// Color of this custom base layer.
///
[DataField("color")]
public Color Color { get; }
}