1
0

TabletopGameComponent.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Numerics;
  2. namespace Content.Server.Tabletop.Components
  3. {
  4. /// <summary>
  5. /// A component that makes an object playable as a tabletop game.
  6. /// </summary>
  7. [RegisterComponent, Access(typeof(TabletopSystem))]
  8. public sealed partial class TabletopGameComponent : Component
  9. {
  10. /// <summary>
  11. /// The localized name of the board. Shown in the UI.
  12. /// </summary>
  13. [DataField]
  14. public LocId BoardName { get; private set; } = "tabletop-default-board-name";
  15. /// <summary>
  16. /// The type of method used to set up a tabletop.
  17. /// </summary>
  18. [DataField(required: true)]
  19. public TabletopSetup Setup { get; private set; } = new TabletopChessSetup();
  20. /// <summary>
  21. /// The size of the viewport being opened. Must match the board dimensions otherwise you'll get the space parallax (unless that's what you want).
  22. /// </summary>
  23. [DataField]
  24. public Vector2i Size { get; private set; } = (300, 300);
  25. /// <summary>
  26. /// The zoom of the viewport camera.
  27. /// </summary>
  28. [DataField]
  29. public Vector2 CameraZoom { get; private set; } = Vector2.One;
  30. /// <summary>
  31. /// The specific session of this tabletop.
  32. /// </summary>
  33. [ViewVariables]
  34. public TabletopSession? Session { get; set; } = null;
  35. }
  36. }