public Game() { gameIsGoing = true; table = new Table(); bazaar = new Bazaar(); players = new List <Player>(); players.Add(new Player(table, bazaar)); players.Add(new Player(table, bazaar)); var firstPlayerHand = players[0].hand; var secondPlayerHand = players[1].hand; var smallestDouble = 7; for (var i = 0; i < 7; ++i) { if (firstPlayerHand[i].IsDouble() && firstPlayerHand[i].Left != 0) { smallestDouble = firstPlayerHand[i].Left; whichPlayerIsMoving = 0; } if (secondPlayerHand[i].IsDouble() && secondPlayerHand[i].Left != 0 && secondPlayerHand[i].Left < smallestDouble) { smallestDouble = secondPlayerHand[i].Left; whichPlayerIsMoving = 1; } } }
public Player(Table table, Bazaar bazaar) { this.table = table; this.bazaar = bazaar; hand = new List <Dice>(); for (var i = 0; i < 7; ++i) { hand.Add(this.bazaar.GetDice()); } }