checkpoint
This commit is contained in:
35
Gameboard.ShogiUI.BoardState/Position.cs
Normal file
35
Gameboard.ShogiUI.BoardState/Position.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user