Files
Shogi/Gameboard.ShogiUI.BoardState/Position.cs
2021-02-23 18:03:23 -06:00

36 lines
534 B
C#

using System;
namespace Gameboard.ShogiUI.BoardState
{
public class Position
{
private int x;
private int y;
public int X
{
get => x;
set {
if (value > 8 || value < 0) throw new ArgumentOutOfRangeException();
x = value;
}
}
public int Y
{
get => y;
set
{
if (value > 8 || value < 0) throw new ArgumentOutOfRangeException();
y = value;
}
}
public Position(int x, int y)
{
X = x;
Y = y;
}
}
}