Esempio n. 1
0
        public ImplementedGameState(int players, Dictionary <CamelColor, Position> startingPositions, int boardSize = 16, int startingMoney = 3) : this()
        {
            RemainingDice = CamelHelper.GetAllCamelColors();
            BettingCards  = ImplementedBettingCard.GetAllBettingCards();

            BoardSize = boardSize;
            Round     = 0;

            for (var i = 0; i < players; i++)
            {
                Money[i]        = startingMoney;
                Traps[i]        = new Trap();
                Disqualified[i] = false;
            }

            var h = 0;

            foreach (var item in startingPositions.OrderBy(x => x.Value.Location).ThenBy(x => x.Value.Height))
            {
                Camels.Add(new Camel()
                {
                    CamelColor = item.Key,
                    Location   = item.Value.Location,
                    Height     = h++,
                });
            }
        }
Esempio n. 2
0
        private void ResetRound()
        {
            StartingPlayer          = (StartingPlayer + 1) % Players.Count;
            CurrentPlayer           = StartingPlayer;
            GameState.RemainingDice = CamelHelper.GetAllCamelColors();
            GameState.BettingCards  = ImplementedBettingCard.GetAllBettingCards();
            GameState.Round++;

            History.Add(new StateChange(StateAction.NewRound, -1, CamelColor.Blue, GameState.Round));

            foreach (var playerTrapPair in GameState.Traps)
            {
                playerTrapPair.Value.Location = -1;
            }
        }