SelectableBorgModuleComponent.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Shared.Actions;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. namespace Content.Shared.Silicons.Borgs.Components;
  6. /// <summary>
  7. /// This is used for <see cref="BorgModuleComponent"/>s that can be "swapped" to, as opposed to having passive effects.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, Access(typeof(SharedBorgSystem))]
  10. public sealed partial class SelectableBorgModuleComponent : Component
  11. {
  12. [DataField("moduleSwapAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
  13. public string? ModuleSwapActionId = "ActionBorgSwapModule";
  14. /// <summary>
  15. /// The sidebar action for swapping to this module.
  16. /// </summary>
  17. [DataField("moduleSwapActionEntity")] public EntityUid? ModuleSwapActionEntity;
  18. }
  19. public sealed partial class BorgModuleActionSelectedEvent : InstantActionEvent
  20. {
  21. }
  22. /// <summary>
  23. /// Event raised by-ref on a module when it is selected
  24. /// </summary>
  25. [ByRefEvent]
  26. public readonly record struct BorgModuleSelectedEvent(EntityUid Chassis);
  27. /// <summary>
  28. /// Event raised by-ref on a module when it is deselected.
  29. /// </summary>
  30. [ByRefEvent]
  31. public readonly record struct BorgModuleUnselectedEvent(EntityUid Chassis);