Exemplo n.º 1
0
        private static void Main()
        {
            IPlayer southPlayer = new AnnabelleBransfordAI("South dummy");
            IPlayer eastPlayer = new DummyPlayer("East dummy");
            IPlayer northPlayer = new AnnabelleBransfordAI("North dummy");
            IPlayer westPlayer = new DummyPlayer("West dummy");
            var game = new GameManager(southPlayer, eastPlayer, northPlayer, westPlayer);
            game.GameInfo.PlayerBid += GameInfoOnPlayerBid;
            game.GameInfo.CardPlayed += GameInfoOnCardPlayed;

            int testSouthNorth = 0;
            int testEastWest = 0;
            for (int j = 0; j < 25; j++)
            {
                testSouthNorth = 0;
                testEastWest = 0;
                for (int i = 0; i < 5000; i++)
                {
                    game.StartNewGame();
                    if (game.SouthNorthScore > game.EastWestScore)
                    {
                        testSouthNorth++;
                    }
                    else
                    {
                        testEastWest++;
                    }
                    //Console.WriteLine("{0} - {1}", game.SouthNorthScore, game.EastWestScore);
                }
                Console.WriteLine("Games won SN: {0} - Games won EW: {1}", testSouthNorth, testEastWest );
            }
        }
Exemplo n.º 2
0
        private readonly Card[,] playerCards; // We are keeping local information about cards to prevent cheating from players (e.g. playing card that they don't own)

        #endregion Fields

        #region Constructors

        public DealManager(GameManager game)
        {
            this.game = game;

            this.cardDeck = new Queue<Card>(CardsHelper.GetFullCardDeck());
            Debug.Assert(this.cardDeck != null && this.cardDeck.Count == 32, "The card deck is not complete!");

            this.playerCards = new Card[4, 8]; // 4 players, 8 cards for each player
        }
Exemplo n.º 3
0
        public static void Main()
        {
            Console.WriteLine("JustBelot 1.0.20130220");
            Console.Write("Please enter player name: ");
            var playerName = Console.ReadLine();

            IPlayer southPlayer = new ConsoleHumanPlayer(playerName);
            IPlayer eastPlayer = new DummyPlayer();
            IPlayer northPlayer = new DummyPlayer();
            IPlayer westPlayer = new DummyPlayer();

            var game = new GameManager(southPlayer, eastPlayer, northPlayer, westPlayer);
            game.StartNewGame();
        }
        public DealManager(GameManager game)
        {
            this.game = game;

            this.cardDeck = new Queue<Card>(CardsCollection.FullDeckOfCards);

            this.playerCards = new[] { new Hand(), new Hand(), new Hand(), new Hand() }; // 4 players

            this.southNorthPlayersCardsTaken = new CardsCollection();
            this.eastWestPlayersCardsTaken = new CardsCollection();

            this.southNorthBelotes = 0;
            this.eastWestBelotes = 0;

            this.southNorthTeamTakesLastHand = null;
        }
Exemplo n.º 5
0
        private static void Main()
        {
            IPlayer southPlayer = new DummyPlayer("South dummy"); // new DebugDummyPlayer("South debug dummy");
            IPlayer eastPlayer = new DummyPlayer("East dummy");
            IPlayer northPlayer = new DummyPlayer("North dummy", alwaysPass: false);
            IPlayer westPlayer = new DummyPlayer("West dummy", alwaysPass: false);
            var game = new GameManager(southPlayer, eastPlayer, northPlayer, westPlayer);
            game.GameInfo.PlayerBid += GameInfoOnPlayerBid;
            game.GameInfo.CardPlayed += GameInfoOnCardPlayed;

            for (int i = 0; i < 10000; i++)
            {
                game.StartNewGame();
                //// Console.WriteLine("{0} - {1}", game.SouthNorthScore, game.EastWestScore);
            }
        }
Exemplo n.º 6
0
        public static void Main()
        {
            // Initialize console properties
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            ConsoleHelper.ResizeConsole(80, 20);
            Console.OutputEncoding = Encoding.Unicode;

            ConsoleHelper.DrawTextBoxTopLeft(Settings.ProgramName, 0, 0, ConsoleColor.Black, ConsoleColor.DarkGray);
            ConsoleHelper.WriteOnPosition("Please enter player name: ", 20, 9, ConsoleColor.Black, ConsoleColor.DarkGray);
            var playerName = Console.ReadLine();
            Console.Clear();

            IPlayer southPlayer = new ConsoleHumanPlayer(playerName);
            IPlayer eastPlayer = new DummyPlayer("East dummy");
            IPlayer northPlayer = new DummyPlayer("North dummy");
            IPlayer westPlayer = new DummyPlayer("West dummy");

            var game = new GameManager(southPlayer, eastPlayer, northPlayer, westPlayer);
            game.StartNewGame();
        }