using System.Collections.Generic; using Content.Shared.Chemistry.Reagent; using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set; namespace Content.Shared.Chemistry.Reaction; [RegisterComponent] public sealed class ReactiveComponent : Component { /// /// A dictionary of reactive groups -> methods that work on them. /// [DataField("groups", readOnly: true, serverOnly: true, customTypeSerializer: typeof(PrototypeIdDictionarySerializer, ReactiveGroupPrototype>))] public Dictionary>? ReactiveGroups; /// /// Special reactions that this prototype can specify, outside of any that reagents already apply. /// Useful for things like monkey cubes, which have a really prototype-specific effect. /// [DataField("reactions", true, serverOnly: true)] public List? Reactions; } [DataDefinition] public sealed class ReactiveReagentEffectEntry { [DataField("methods")] public HashSet Methods = default!; [DataField("reagents", customTypeSerializer: typeof(PrototypeIdHashSetSerializer))] public HashSet? Reagents = null; [DataField("effects", required: true)] public List Effects = default!; [DataField("groups", required: true, readOnly: true, serverOnly: true, customTypeSerializer:typeof(PrototypeIdDictionarySerializer, ReactiveGroupPrototype>))] public Dictionary> ReactiveGroups { get; } = default!; }