28 lines
496 B
C#
28 lines
496 B
C#
|
using System;
|
||
|
|
||
|
using Microsoft.Xna.Framework.Graphics;
|
||
|
|
||
|
using Syntriax.Engine.Core.Abstract;
|
||
|
|
||
|
namespace Syntriax.Engine.Core;
|
||
|
|
||
|
public class Sprite : ISprite
|
||
|
{
|
||
|
public Action<ISprite>? OnTextureChanged { get; set; }
|
||
|
|
||
|
private Texture2D _texture = null!;
|
||
|
|
||
|
public Texture2D Texture2D
|
||
|
{
|
||
|
get => _texture;
|
||
|
set
|
||
|
{
|
||
|
if (_texture == value)
|
||
|
return;
|
||
|
|
||
|
_texture = value;
|
||
|
OnTextureChanged?.Invoke(this);
|
||
|
}
|
||
|
}
|
||
|
}
|