36 lines
534 B
C#
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;
|
|
}
|
|
}
|
|
}
|