SMAPI/Mods/Automate/Common/SpriteInfo.cs

32 lines
1005 B
C#
Raw Normal View History

2019-04-10 01:22:10 +08:00
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Pathoschild.Stardew.Common
{
/// <summary>Represents a single sprite in a spritesheet.</summary>
internal class SpriteInfo
{
/*********
** Accessors
*********/
/// <summary>The spritesheet texture.</summary>
public Texture2D Spritesheet { get; }
/// <summary>The area in the spritesheet containing the sprite.</summary>
public Rectangle SourceRectangle { get; }
/*********
** Public methods
*********/
/// <summary>Construct an instance.</summary>
/// <param name="spritesheet">The spritesheet texture.</param>
/// <param name="sourceRectangle">The area in the spritesheet containing the sprite.</param>
public SpriteInfo(Texture2D spritesheet, Rectangle sourceRectangle)
{
this.Spritesheet = spritesheet;
this.SourceRectangle = sourceRectangle;
}
}
}