Ejemplo n.º 1
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            gameDeck   = new Deck();
            playerName = "";
            gameStateManager.switchState(new IntroState(ref playerName)); //SpadesPlayer));
            gameStateManager.Process();
            initializePlayerBoardsPosition();                             // re position
            int         i      = 0;
            RegistryKey regKey = Registry.CurrentUser.OpenSubKey("Software\\Games\\CallBreak");

            foreach (player p in gameData.CurrentPlayerList)
            {
                string key = "AIPlayer" + i.ToString();
                if (i == 0)
                {
                    p.Name = playerName;
                }
                else
                {
                    p.Name = regKey.GetValue(key, "AI - I").ToString();
                }
                i++;
            }

            startGame();
        }
Ejemplo n.º 2
0
        public bool startGameLoop()
        {
            gameStateManager.switchState(new IntroState(gameStateManager));
            gameStateManager.Process();


            for (int i = 1; i <= 5; i++)
            {
                startRound(1);
                gameStateManager.switchState(new PlayingState(ref SpadesPlayer));
                gameStateManager.Process();


                gameStateManager.switchState(new BiddingState(ref SpadesPlayer));
                gameStateManager.Process();
                gameStateManager.switchState(new CardPlayingState(ref SpadesPlayer));
                gameStateManager.Process();
            }



            return(true);
        }