SharedGridDraggingSystem.cs 935 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System.Numerics;
  2. using Robust.Shared.Serialization;
  3. namespace Content.Shared.Maps;
  4. /// <summary>
  5. /// Helper system to allow you to move entities with a mouse.
  6. /// </summary>
  7. public abstract class SharedGridDraggingSystem : EntitySystem
  8. {
  9. public const string CommandName = "griddrag";
  10. }
  11. /// <summary>
  12. /// Sent from server to client if grid dragging is toggled on.
  13. /// </summary>
  14. [Serializable, NetSerializable]
  15. public sealed class GridDragToggleMessage : EntityEventArgs
  16. {
  17. public bool Enabled;
  18. }
  19. /// <summary>
  20. /// Raised on the client to request a grid move to a specific position.
  21. /// </summary>
  22. [Serializable, NetSerializable]
  23. public sealed class GridDragRequestPosition : EntityEventArgs
  24. {
  25. public NetEntity Grid;
  26. public Vector2 WorldPosition;
  27. }
  28. [Serializable, NetSerializable]
  29. public sealed class GridDragVelocityRequest : EntityEventArgs
  30. {
  31. public NetEntity Grid;
  32. public Vector2 LinearVelocity;
  33. }