AtmosPipeColorComponent.cs 626 B

123456789101112131415161718192021222324
  1. using Content.Server.Atmos.Piping.EntitySystems;
  2. using JetBrains.Annotations;
  3. namespace Content.Server.Atmos.Piping.Components;
  4. [RegisterComponent]
  5. public sealed partial class AtmosPipeColorComponent : Component
  6. {
  7. [DataField]
  8. public Color Color { get; set; } = Color.White;
  9. [ViewVariables(VVAccess.ReadWrite), UsedImplicitly]
  10. public Color ColorVV
  11. {
  12. get => Color;
  13. set => IoCManager.Resolve<IEntityManager>().System<AtmosPipeColorSystem>().SetColor(Owner, this, value);
  14. }
  15. }
  16. [ByRefEvent]
  17. public record struct AtmosPipeColorChangedEvent(Color color)
  18. {
  19. public Color Color = color;
  20. }