TilemapTileAnimationFrame.cs 918 B

1234567891011121314151617181920212223242526272829
  1. namespace MonoGame.Extended.Tilemaps
  2. {
  3. /// <summary>
  4. /// Represents a single frame in a tile animation.
  5. /// </summary>
  6. public readonly struct TilemapTileAnimationFrame
  7. {
  8. /// <summary>
  9. /// Gets the local tile ID for this frame.
  10. /// </summary>
  11. public int TileId { get; }
  12. /// <summary>
  13. /// Gets the duration of this frame in seconds.
  14. /// </summary>
  15. public float Duration { get; }
  16. /// <summary>
  17. /// Initializes a new instance of the <see cref="TilemapTileAnimationFrame"/> struct.
  18. /// </summary>
  19. /// <param name="tileId">The local tile ID for this frame.</param>
  20. /// <param name="duration">The duration of this frame in seconds.</param>
  21. public TilemapTileAnimationFrame(int tileId, float duration)
  22. {
  23. TileId = tileId;
  24. Duration = duration;
  25. }
  26. }
  27. }