1
0

ConveyorComponent.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Content.Shared.DeviceLinking;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. using Robust.Shared.Serialization;
  5. namespace Content.Shared.Conveyor;
  6. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  7. public sealed partial class ConveyorComponent : Component
  8. {
  9. /// <summary>
  10. /// The angle to move entities by in relation to the owner's rotation.
  11. /// </summary>
  12. [ViewVariables(VVAccess.ReadWrite)]
  13. [DataField, AutoNetworkedField]
  14. public Angle Angle = Angle.Zero;
  15. /// <summary>
  16. /// The amount of units to move the entity by per second.
  17. /// </summary>
  18. [ViewVariables(VVAccess.ReadWrite)]
  19. [DataField, AutoNetworkedField]
  20. public float Speed = 2f;
  21. /// <summary>
  22. /// The current state of this conveyor
  23. /// </summary>
  24. [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  25. public ConveyorState State;
  26. [ViewVariables, AutoNetworkedField]
  27. public bool Powered;
  28. [DataField]
  29. public ProtoId<SinkPortPrototype> ForwardPort = "Forward";
  30. [DataField]
  31. public ProtoId<SinkPortPrototype> ReversePort = "Reverse";
  32. [DataField]
  33. public ProtoId<SinkPortPrototype> OffPort = "Off";
  34. }
  35. [Serializable, NetSerializable]
  36. public enum ConveyorVisuals : byte
  37. {
  38. State
  39. }
  40. [Serializable, NetSerializable]
  41. public enum ConveyorState : byte
  42. {
  43. Off,
  44. Forward,
  45. Reverse
  46. }