IAnimation.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) Craftwork Games. All rights reserved.
  2. // Licensed under the MIT license.
  3. // See LICENSE file in the project root for full license information.
  4. using System;
  5. namespace MonoGame.Extended.Animations;
  6. /// <summary>
  7. /// Defines the interface for an animation, specifying properties of the animation such as frames, looping, reversing,
  8. /// and ping-pong effects.
  9. /// </summary>
  10. public interface IAnimation
  11. {
  12. /// <summary>
  13. /// Gets the name of the animation.
  14. /// </summary>
  15. string Name { get; }
  16. /// <summary>
  17. /// Gets the read-only collection of frames in the animation.
  18. /// </summary>
  19. ReadOnlySpan<IAnimationFrame> Frames { get; }
  20. /// <summary>
  21. /// Gets the total number of frames in the animation.
  22. /// </summary>
  23. int FrameCount { get; }
  24. /// <summary>
  25. /// Gets a value indicating whether the animation should loop.
  26. /// </summary>
  27. bool IsLooping { get; }
  28. /// <summary>
  29. /// Gets a value indicating whether the animation is reversed.
  30. /// </summary>
  31. bool IsReversed { get; }
  32. /// <summary>
  33. /// Gets a value indicating whether the animation should ping-pong (reverse direction at the ends).
  34. /// </summary>
  35. bool IsPingPong { get; }
  36. }