BorgModuleComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Robust.Shared.GameStates;
  2. namespace Content.Shared.Silicons.Borgs.Components;
  3. /// <summary>
  4. /// This is used for modules that can be inserted into borgs
  5. /// to give them unique abilities and attributes.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, Access(typeof(SharedBorgSystem))]
  8. [AutoGenerateComponentState]
  9. public sealed partial class BorgModuleComponent : Component
  10. {
  11. /// <summary>
  12. /// The entity this module is installed into
  13. /// </summary>
  14. [DataField("installedEntity")]
  15. public EntityUid? InstalledEntity;
  16. public bool Installed => InstalledEntity != null;
  17. /// <summary>
  18. /// If true, this is a "default" module that cannot be removed from a borg.
  19. /// </summary>
  20. [DataField]
  21. [AutoNetworkedField]
  22. public bool DefaultModule;
  23. }
  24. /// <summary>
  25. /// Raised on a module when it is installed in order to add specific behavior to an entity.
  26. /// </summary>
  27. /// <param name="ChassisEnt"></param>
  28. [ByRefEvent]
  29. public readonly record struct BorgModuleInstalledEvent(EntityUid ChassisEnt);
  30. /// <summary>
  31. /// Raised on a module when it's uninstalled in order to
  32. /// </summary>
  33. /// <param name="ChassisEnt"></param>
  34. [ByRefEvent]
  35. public readonly record struct BorgModuleUninstalledEvent(EntityUid ChassisEnt);