public void MaxPlacementOf12() ///Each player is allowed to place up to 12 cows { Player p1 = new Player(Symbol.CB); Player p2 = new Player(Symbol.CW); ICowBox cowBox = Substitute.For <ICowBox>(); bool flag1 = false; bool flag2 = true; IBoard board = Substitute.For <IBoard>(); IWorld world = Substitute.For <IWorld>(); world = new World(p1, p2); int blackcows = cowBox.getcowsInBox(p1.symbol); int whitecows = cowBox.getcowsInBox(p2.symbol); if (p1.Phase == Phase.moving) { if (blackcows == 0) { Assert.That(false); } } if (p2.Phase == Phase.moving) { if (blackcows == 0) { Assert.That(false); } } }
public bool isValidPlace(string pos, IPlayer player) { if (isValidPos(pos)) { Tile tile = board.getTile(pos); if (tile.cond.Symbol == Symbol.BL && cowBox.getcowsInBox(Symbol.BL) > 0) { return(true); } } return(false); }
public bool cowsInBox(ICowBox cowBox, IPlayer player) { //throw new NotImplementedException(); return(cowBox.getcowsInBox(player.symbol) > 0); }