예제 #1
0
        /// <summary>Starts a game of Sea Battle, the type will depend on what the user has selected in the main menu.</summary>
        private static void RunGame()
        {
            Game.Game curGame;
            switch (selected)
            {
            case 0:
                curGame = new Game._1Player(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                break;

            case 1:
                curGame = new Game._2Player(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                break;

            case 2:
                curGame = new Game.LanHost(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                break;

            case 3:
                curGame = new Game.LanClient(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                break;

            default:
                return;
            }

            curGame.RunGame();
        }
예제 #2
0
파일: Program.cs 프로젝트: WGDEVS/SeaBattle
        /// <summary>Starts a game of Sea Battle, the type will depend on what the user has selected in the main menu.</summary>
        private static void RunGame()
        {
            Game.Game curGame;
            switch (selected) {
                case 0:
                    curGame = new Game._1Player(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                    break;
                case 1:
                    curGame = new Game._2Player(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                    break;
                case 2:
                    curGame = new Game.LanHost(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                    break;
                case 3:
                    curGame = new Game.LanClient(SettingsEnabled[0], SettingsEnabled[1], SettingsEnabled[2], 10, 10, Shiplist, PlaneList);
                    break;
                default:
                    return;
            }

            curGame.RunGame();
        }