TilemapPointObject.cs 1020 B

12345678910111213141516171819202122232425262728293031323334
  1. using Microsoft.Xna.Framework;
  2. namespace MonoGame.Extended.Tilemaps
  3. {
  4. /// <summary>
  5. /// Represents a point object in a tilemap with no spatial extent.
  6. /// </summary>
  7. /// <remarks>
  8. /// Point objects are typically used as markers or spawn points and do not
  9. /// have collision volumes.
  10. /// </remarks>
  11. public class PointObject : TilemapObject
  12. {
  13. /// <inheritdoc/>
  14. public override RectangleF Bounds
  15. {
  16. get
  17. {
  18. return new(Position.X, Position.Y, 0, 0);
  19. }
  20. }
  21. // NOTE: Point objects have no bounding volume for collision detection
  22. /// <summary>
  23. /// Initializes a new instance of the <see cref="PointObject"/> class.
  24. /// </summary>
  25. /// <param name="id">The unique identifier for the object.</param>
  26. /// <param name="position">The position of the point.</param>
  27. public PointObject(int id, Vector2 position) : base(id, position)
  28. {
  29. }
  30. }
  31. }