checkpoint

This commit is contained in:
2021-02-23 18:03:23 -06:00
parent 8d79c75616
commit f644795cd3
38 changed files with 1451 additions and 177 deletions

View File

@@ -0,0 +1,29 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gameboard.ShogiUI.BoardState
{
public class Array2D<T> : IEnumerable
{
private readonly T[] array;
private readonly int width;
public Array2D(int width, int height)
{
this.width = width;
array = new T[width * height];
}
public T this[int x, int y]
{
get => array[y * width + x];
set => array[y * width + x] = value;
}
IEnumerator IEnumerable.GetEnumerator() => array.GetEnumerator();
}
}