Example #1
0
        public PerudoEngine()
        {
            Queue <IPlayer> _players = new Queue <IPlayer>();

            Console.WriteLine("Home");
            Console.WriteLine("How many Players : ");

            var input = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i < input; i++)
            {
                var human = new Human((ushort)(i + 1));
                _players.Enqueue(human);
                Console.Write(human);
                Console.WriteLine();
                Thread.Sleep(200);
            }

            _monitor = new BoardMonitor(_players);

            _playerControllers = new Queue <PlayerController>();

            foreach (var player in _players)
            {
                _playerControllers.Enqueue(new PlayerController(player));
            }

            _currentPlayer = _playerControllers.Peek();

            _state = State.StartRound;
        }
Example #2
0
        public Bet(int quantity, int faceValue, BoardMonitor boardMonitor)
        {
            if (quantity > boardMonitor.TotalDiceInPlay || faceValue < 1 || faceValue > 6)
            {
                throw new BetNotValidException();
            }

            Quantity  = quantity;
            FaceValue = (DiceFaces)faceValue;
        }