using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared._EstacaoPirata.Cards.Stack; /// /// This is used for holding the prototype ids of the cards in the stack or hand. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class CardStackComponent : Component { [DataField] public List InitialContent = []; [DataField] public SoundSpecifier ShuffleSound = new SoundCollectionSpecifier("cardFan"); [DataField] public SoundSpecifier PickUpSound = new SoundCollectionSpecifier("cardSlide"); [DataField] public SoundSpecifier PlaceDownSound = new SoundCollectionSpecifier("cardShove"); /// /// The containers that contain the items held in the stack /// [ViewVariables] public Container ItemContainer = default!; /// /// The list EntityUIds of Cards /// [DataField, AutoNetworkedField] public List Cards = []; } [Serializable, NetSerializable] public sealed class CardStackInitiatedEvent(NetEntity cardStack) : EntityEventArgs { public NetEntity CardStack = cardStack; } /// /// This gets Updated when new cards are added or removed from the stack /// [Serializable, NetSerializable] public sealed class CardStackQuantityChangeEvent(NetEntity stack, NetEntity? card, StackQuantityChangeType type) : EntityEventArgs { public NetEntity Stack = stack; public NetEntity? Card = card; public StackQuantityChangeType Type = type; } [Serializable, NetSerializable] public enum StackQuantityChangeType : sbyte { Added, Removed, Joined, Split } [Serializable, NetSerializable] public sealed class CardStackReorderedEvent(NetEntity stack) : EntityEventArgs { public NetEntity Stack = stack; } [Serializable, NetSerializable] public sealed class CardStackFlippedEvent(NetEntity cardStack) : EntityEventArgs { public NetEntity CardStack = cardStack; }