Esempio n. 1
0
        private void StartGame()
        {
            Setup.SetupGameState();

            //show player windows
            foreach (HumanPlayer p in Game.Instance.HumanPlayers)
            {
                GameWindow w = new GameWindow(p);
                p.Window = w;
                w.Show();
                if (PlayerWindows.Count > 0)
                    PlayerWindows.AddAfter(PlayerWindows.Last, w);
                else
                    PlayerWindows.AddFirst(w);
            }
            
            if (Game.Instance.HumanPlayers.Count() < 1)
            {
                foreach (ComputerPlayer cp in Game.Instance.ComputerPlayers)
                {
                    AIWindow w = new AIWindow(cp);
                    cp.Window = w;
                    w.Show();
                }
            }

            //Give each ComputerPlayer an AI Provider instance and utility functions
            Setup.SetupComputer();

            //Call this to give each player tiles, and ask the first player for a move.
            Game.Instance.Start();
                        
        }
Esempio n. 2
0
        private void StartGame()
        {
            Setup.SetupGameState();

            //show player windows
            foreach (HumanPlayer p in Game.Instance.HumanPlayers)
            {
                GameWindow w = new GameWindow(p);
                p.Window = w;
                w.Show();
                if (PlayerWindows.Count > 0)
                {
                    PlayerWindows.AddAfter(PlayerWindows.Last, w);
                }
                else
                {
                    PlayerWindows.AddFirst(w);
                }
            }

            if (Game.Instance.HumanPlayers.Count() < 1)
            {
                foreach (ComputerPlayer cp in Game.Instance.ComputerPlayers)
                {
                    AIWindow w = new AIWindow(cp);
                    cp.Window = w;
                    w.Show();
                }
            }

            //Give each ComputerPlayer an AI Provider instance and utility functions
            Setup.SetupComputer();

            //Call this to give each player tiles, and ask the first player for a move.
            Game.Instance.Start();
        }