public static IBoard Create(Player turn, int[] configuration) { IBoard retVal = new Board() { Turn = turn }; for (int i = 0; i < configuration.Count(); i++) { retVal.Cups.ToArray()[i].Seeds = configuration[i]; } return retVal; }
public void TestCrossCup() { Board b = new Board(); ICup[] cups = b.Cups.ToArray(); Assert.AreEqual(cups[12], b.CrossCup(cups[0])); Assert.AreEqual(cups[11], b.CrossCup(cups[1])); Assert.AreEqual(cups[10], b.CrossCup(cups[2])); Assert.AreEqual(cups[9], b.CrossCup(cups[3])); Assert.AreEqual(cups[8], b.CrossCup(cups[4])); Assert.AreEqual(cups[7], b.CrossCup(cups[5])); Assert.AreEqual(cups[5], b.CrossCup(cups[7])); Assert.AreEqual(cups[4], b.CrossCup(cups[8])); Assert.AreEqual(cups[3], b.CrossCup(cups[9])); Assert.AreEqual(cups[2], b.CrossCup(cups[10])); Assert.AreEqual(cups[1], b.CrossCup(cups[11])); Assert.AreEqual(cups[0], b.CrossCup(cups[12])); }
public static IBoard Copy(IBoard b) { IBoard retVal = new Board(); Set(retVal, b); return retVal; }