Files
Shogi/Shogi.Domain/DomainExtensions.cs
2022-06-10 21:53:05 -05:00

20 lines
436 B
C#

using Shogi.Domain.Pieces;
namespace Shogi.Domain
{
internal static class DomainExtensions
{
public static bool IsKing(this Piece self) => self.WhichPiece == WhichPiece.King;
public static bool IsBetween(this float self, float min, float max)
{
return self >= min && self <= max;
}
public static bool IsInsideBoardBoundary(this Vector2 self)
{
return self.X.IsBetween(0, 8) && self.Y.IsBetween(0, 8);
}
}
}