public void Play(Action callBack)
        {
            this._isPlaying   = true;
            this._actCallback = callBack;
            this.stateType    = ProdTorpedoSalvoPhase3.StateType.Attack;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetBollboardTarget(true, this._fieldCam[0].get_transform());
            battleShips.SetBollboardTarget(false, this._fieldCam[1].get_transform());
            BattleTaskManager.GetBattleShips().SetTorpedoSalvoWakeAngle(true);
            this.CreateTorpedoWake();
            if (this._isProtect[0])
            {
                this._fieldCam[0].get_transform().set_position(new Vector3(this._torpedoProtect._listBattleShipF.get_Item(0).get_transform().get_position().x, 7.5f, -40f));
                this._fieldCam[0].get_transform().set_localRotation(Quaternion.Euler(new Vector3(10.5f, 0f, 0f)));
            }
            if (this._isProtect[1])
            {
                this._fieldCam[1].get_transform().set_position(new Vector3(this._torpedoProtect._listBattleShipE.get_Item(0).get_transform().get_position().x, 7.5f, 42f));
                this._fieldCam[1].get_transform().set_localRotation(Quaternion.Euler(new Vector3(10.5f, 180f, 0f)));
            }
            if (this._isProtect[0] || this._isProtect[1])
            {
                this._torpedoProtect.Play(new Action(this._torpedoInjection));
            }
            else
            {
                this._torpedoInjection();
            }
        }
 private void PlayNextFocusShipCircleAnimation()
 {
     if (_clsEffectModel.NextActionShip != null)
     {
         ShipModel_Battle focusShip   = _clsEffectModel.NextActionShip;
         BattleShips      battleShips = BattleTaskManager.GetBattleShips();
         int cnt = 0;
         battleShips.bufferShipCirlce[0].ForEach(delegate(UIBufferCircle x)
         {
             x.PlayFocusCircleAnimation(focusShip.IsFriend() && focusShip.Index == cnt);
             cnt++;
         });
         cnt = 0;
         battleShips.bufferShipCirlce[1].ForEach(delegate(UIBufferCircle x)
         {
             x.PlayFocusCircleAnimation(!focusShip.IsFriend() && focusShip.Index == cnt);
             cnt++;
         });
         List <UIBufferFleetCircle> bufferFleetCircle = battleShips.bufferFleetCircle;
         bufferFleetCircle.ForEach(delegate(UIBufferFleetCircle x)
         {
             x.PlayFocusCircleAnimation();
         });
     }
 }
Exemplo n.º 3
0
        public UniRx.IObservable <bool> Play()
        {
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.CommandBuffer);
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(isSplit: false);
            battleCameras.fieldDimCamera.maskAlpha = 0f;
            battleCameras.SwitchMainCamera(FleetType.Friend);
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras[0];

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.pointOfGaze        = Vector3.Lerp(BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Friend].position, BattleTaskManager.GetBattleField().dicFleetAnchor[FleetType.Enemy].position, 0.8f);
            battleFieldCamera.vignetting.enabled = true;
            battleFieldCamera.glowEffect.enabled = true;
            battleShips.SetBollboardTarget(null);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            Observable.NextFrame().Subscribe(delegate
            {
                CalcInitLineRotation();
                PlayLineAnimation();
            });
            return(Observable.FromCoroutine((UniRx.IObserver <bool> observer) => AnimationObserver(observer)));
        }
Exemplo n.º 4
0
        static string SaveGame(BattleShips game)
        {
            var saveName = AskUserForSaveGameName(1, 30);
            BattleShipsSaveJson battleShips = new BattleShipsSaveJson()
            {
                Height      = game.Height,
                Width       = game.Width,
                Player1     = game.Player1,
                Player1Turn = game.Player1Turn,
                Player2     = game.Player2,
                SaveName    = saveName,
                GameType    = game.GameType
            };

            SaveTool.SaveGameToFile(battleShips);

            using var ctx = new AppDbContext();
            var battleShipsSave = game.CreateBattleShipsSave(saveName);

            if (ctx.BattleShipsSaves.Any(e => e.SaveName == saveName))
            {
                var save = ctx.BattleShipsSaves.FirstOrDefault(e => e.SaveName == saveName);
                game.UpdateBattleShipsSave(save !);
                ctx.Update(save);
            }
            else
            {
                ctx.Add(battleShipsSave);
            }
            ctx.SaveChanges();

            return("");
        }
Exemplo n.º 5
0
        public void Play(Action callBack)
        {
            _isPlaying   = true;
            _actCallback = callBack;
            stateType    = StateType.Attack;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetBollboardTarget(isFriend: true, _fieldCam[0].transform);
            battleShips.SetBollboardTarget(isFriend: false, _fieldCam[1].transform);
            BattleTaskManager.GetBattleShips().SetTorpedoSalvoWakeAngle(isSet: true);
            CreateTorpedoWake();
            if (_isProtect[0])
            {
                Transform obj      = _fieldCam[0].transform;
                Vector3   position = _torpedoProtect._listBattleShipF[0].transform.position;
                obj.position = new Vector3(position.x, 7.5f, -40f);
                _fieldCam[0].transform.localRotation = Quaternion.Euler(new Vector3(10.5f, 0f, 0f));
            }
            if (_isProtect[1])
            {
                Transform obj2      = _fieldCam[1].transform;
                Vector3   position2 = _torpedoProtect._listBattleShipE[0].transform.position;
                obj2.position = new Vector3(position2.x, 7.5f, 42f);
                _fieldCam[1].transform.localRotation = Quaternion.Euler(new Vector3(10.5f, 180f, 0f));
            }
            if (_isProtect[0] || _isProtect[1])
            {
                _torpedoProtect.Play(_torpedoInjection);
            }
            else
            {
                _torpedoInjection();
            }
        }
Exemplo n.º 6
0
        public void BSCanPlaceAllShips()
        {
            BattleShips battleShipsTest = new BattleShips();

            battleShipsTest.PlaceShip(0, 0, 2, 1, 'A');
            battleShipsTest.PlaceShip(0, 1, 2, 1, 'B');
            battleShipsTest.PlaceShip(0, 2, 2, 1, 'C');
            battleShipsTest.PlaceShip(0, 3, 3, 1, 'D');
            battleShipsTest.PlaceShip(0, 4, 3, 1, 'E');
            battleShipsTest.PlaceShip(0, 5, 3, 1, 'F');
            battleShipsTest.PlaceShip(0, 6, 4, 1, 'G');
            //battleShipsTest.PlaceShip(0, 7, 4, 1, 'H');
            //battleShipsTest.PlaceShip(0, 8, 5, 1, 'I');

            /*char[,] expected = new char[10,10]
             *          {
             *  {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', ' '},
             *  {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', ' '},
             *  {' ', ' ', ' ', 'D', 'E', 'F', 'G', 'H', 'I', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', 'G', 'H', 'I', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'I', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '},
             *  {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}
             * };*/
            Assert.AreEqual(true, battleShipsTest.ValidateShipDirection(0, 7, 4, 'e'));
            Assert.AreEqual(false, battleShipsTest.ValidateShipDirection(0, 7, 4, 'n'));
            Assert.AreEqual(false, battleShipsTest.ValidateShipDirection(0, 7, 4, 's'));
            Assert.AreEqual(false, battleShipsTest.ValidateShipDirection(0, 7, 4, 'w'));
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            BattleShips battleShips = new BattleShips(Height, Width, Player1, Player2)
            {
                ShipsCanTouch = ShipsCanTouch
            };

            battleShips.AddDefaultShipsToPlayerShipList(Player1);
            battleShips.AddDefaultShipsToPlayerShipList(Player2);

            battleShips.PlaceShipsAutomatically(Player1);
            battleShips.PlaceShipsAutomatically(Player2);

            var save = battleShips.CreateBattleShipsSave(GameName);

            if (_context.BattleShipsSaves.Any(e => e.SaveName == GameName))
            {
                ModelState.AddModelError("GameName", "A save game with this name already exists.");
                return(Page());
            }

            await _context.BattleShipsSaves.AddAsync(save);

            await _context.SaveChangesAsync();

            return(RedirectToPage("/PlayGame", new { id = save.Id }));
        }
Exemplo n.º 8
0
        private static void SetUpPlayerShips(BattleShips battleShips, Player player, Menu menu)
        {
            string userInput;

            do
            {
                Console.WriteLine("Enter 'D' for a default ship setup or 'C' to create custom ships.");
                Console.Write(">");
                userInput = Console.ReadLine()?.Trim().ToUpper() ?? "D";
            } while (userInput != "D" && userInput != "C");

            if (userInput == "D")
            {
                battleShips.AddDefaultShipsToPlayerShipList(player);
            }
            else
            {
                do
                {
                    Console.WriteLine($"({player.Ships.Count + 1}) Enter ship name: ");
                    Console.Write(">");
                    var shipName = Console.ReadLine()?.Trim().ToUpper() ?? "Default";
                    var(shipWidth, _, _) = AskForUserInput($"({player.Ships.Count + 1}) Enter ship width",
                                                           battleShips.Width >= battleShips.Height ? battleShips.Width : battleShips.Height, 1, menu);
                    battleShips.AddShipToPlayerShipList(player, new Ship()
                    {
                        Name = shipName, Width = shipWidth
                    });
                } while (player.Ships.Count < 5);
            }
        }
Exemplo n.º 9
0
        public void RadarObjectConvergence()
        {
            BattleTaskManager.GetBattleCameras().fieldCameras[0].glowEffect.enabled = false;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.RadarDeployment(isDeploy: false);
        }
Exemplo n.º 10
0
        public void BSShipIsGone()
        {
            BattleShips battleShipsTest = new BattleShips();

            battleShipsTest.player[battleShipsTest.battleShipOppositePlayer].shipLengths[3] = 0;
            Assert.AreEqual(true, battleShipsTest.IsShipGone(3));
        }
Exemplo n.º 11
0
        private static bool AddShips(BattleShips battleShips, DbContextOptions <ApplicationDbContext> dbOptions)
        {
            var wantsToQuit = false;
            int unAddedShipCount;

            do
            {
                Console.Clear();
                var player = battleShips.GetPlayer(true);
                Console.WriteLine($"{player.Name} choose a ship to add:");
                var gameShips = battleShips.GetUnaddedGameShips();

                var gameShip = BattleShipsConsoleUi.DrawShipList(gameShips, player.Name);

                var(x, y) = GetCoordinates(
                    battleShips,
                    gameShip.Size,
                    true);

                if (x == 100 && y == 100)
                {
                    SaveGameMenu(battleShips, dbOptions);
                    wantsToQuit = true;
                    break;
                }

                var isHorizontal = BattleShipsConsoleUi.IsShipHorizontal;
                battleShips.AddShips(gameShip, x, y, isHorizontal);

                unAddedShipCount = battleShips.GetUnaddedGameShips().Count;
            } while (unAddedShipCount > 0);

            return(wantsToQuit);
        }
Exemplo n.º 12
0
        public IObservable <bool> Play()
        {
            ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();

            observerAction.Executions();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.CommandBuffer);
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SetVerticalSplitCameras(false);
            battleCameras.fieldDimCamera.maskAlpha = 0f;
            battleCameras.SwitchMainCamera(FleetType.Friend);
            BattleFieldCamera battleFieldCamera = battleCameras.fieldCameras.get_Item(0);

            battleFieldCamera.ReqViewMode(CameraActor.ViewMode.FixChasing);
            battleFieldCamera.pointOfGaze = Vector3.Lerp(BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Friend).get_position(), BattleTaskManager.GetBattleField().dicFleetAnchor.get_Item(FleetType.Enemy).get_position(), 0.8f);
            battleFieldCamera.vignetting.set_enabled(true);
            battleFieldCamera.glowEffect.set_enabled(true);
            battleShips.SetBollboardTarget(null);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = cutInEffectCamera.get_transform().FindChild("TorpedoLine/OverlayLine").GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 0f;
            }
            Observable.NextFrame(FrameCountType.Update).Subscribe(delegate(Unit _)
            {
                this.CalcInitLineRotation();
                this.PlayLineAnimation();
            });
            return(Observable.FromCoroutine <bool>((IObserver <bool> observer) => this.AnimationObserver(observer)));
        }
Exemplo n.º 13
0
        public void RadarObjectConvergence()
        {
            BattleTaskManager.GetBattleCameras().fieldCameras.get_Item(0).glowEffect.set_enabled(false);
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.RadarDeployment(false);
        }
Exemplo n.º 14
0
        private void onInitBackground()
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetShipDrawType(FleetType.Enemy, ShipDrawType.Normal);
            battleShips.SetStandingPosition(StandingPositionType.OneRow);
            battleShips.SetLayer(Generics.Layers.ShipGirl);
            BattleField battleField = BattleTaskManager.GetBattleField();

            battleField.ResetFleetAnchorPosition();
            BattleTaskManager.GetPrefabFile().DisposeProdCommandBuffer();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.SwitchMainCamera(FleetType.Friend);
            battleCameras.InitEnemyFieldCameraDefault();
            BattleFieldCamera friendFieldCamera = battleCameras.friendFieldCamera;
            BattleFieldCamera enemyFieldCamera  = battleCameras.enemyFieldCamera;

            battleCameras.isFieldDimCameraEnabled = false;
            friendFieldCamera.ResetMotionBlur();
            friendFieldCamera.clearFlags  = CameraClearFlags.Skybox;
            friendFieldCamera.cullingMask = battleCameras.GetDefaultLayers();
            enemyFieldCamera.cullingMask  = battleCameras.GetEnemyCamSplitLayers();
            battleCameras.SetVerticalSplitCameras(isSplit: true);
            friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            enemyFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Friend].position;

            friendFieldCamera.transform.position      = new Vector3(-51f, 8f, 90f);
            friendFieldCamera.transform.localRotation = Quaternion.Euler(new Vector3(10.5f, 70f, 0f));
            Vector3 position2 = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Enemy].position;

            enemyFieldCamera.transform.position = new Vector3(-51f, 8f, -90f);
            enemyFieldCamera.transform.rotation = Quaternion.Euler(new Vector3(10.5f, 111f, 0f));
            battleField.isEnemySeaLevelActive   = true;
            battleField.AlterWaveDirection(FleetType.Friend, FleetType.Friend);
            battleField.AlterWaveDirection(FleetType.Enemy, FleetType.Enemy);
            BattleShips battleShips2 = BattleTaskManager.GetBattleShips();

            battleShips2.RadarDeployment(isDeploy: false);
            battleShips2.SetBollboardTarget(isFriend: false, enemyFieldCamera.transform);
            battleShips2.SetTorpedoSalvoWakeAngle(isSet: true);
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UITexture component = ((Component)cutInEffectCamera.transform.FindChild("TorpedoLine/OverlayLine")).GetComponent <UITexture>();

            if (component != null)
            {
                component.alpha = 1f;
            }
            BattleTaskManager.GetBattleCameras().fieldDimCamera.maskAlpha = 0f;
            foreach (UIBattleShip value in BattleTaskManager.GetBattleShips().dicFriendBattleShips.Values)
            {
                value.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().friendFieldCamera.transform;
            }
            foreach (UIBattleShip value2 in BattleTaskManager.GetBattleShips().dicEnemyBattleShips.Values)
            {
                value2.billboard.billboardTarget = BattleTaskManager.GetBattleCameras().enemyFieldCamera.transform;
            }
        }
        public void Play(Action onFinished)
        {
            _actOnFinished = onFinished;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.SetStandingPosition(StandingPositionType.CommandBuffer);
            PlayCommand(_clsEffectModel.Command);
        }
        public async Task OnGetShowBoardsAsync(int id)
        {
            var battleShipsSave = await _appDbContext.BattleShipsSaves.FirstOrDefaultAsync(e => e.Id == id);

            BattleShips = new BattleShips(battleShipsSave);
            Id          = id;
            BattleShips.CheckIfGameHasFinished();
        }
Exemplo n.º 17
0
        public void BSWeDontHaveAWinner()
        {
            BattleShips battleShipsTest = new BattleShips();

            battleShipsTest.player[battleShipsTest.battleShipOppositePlayer].shipLengths = new int[9] {
                1, 0, 0, 0, 0, 0, 0, 0, 0
            };
            Assert.AreEqual(false, battleShipsTest.HasAnyoneWonTheGame());
        }
        public async Task OnGetShowShotResultAsync(int id, bool shotHit)
        {
            var battleShipsSave = await _appDbContext.BattleShipsSaves.FirstOrDefaultAsync(e => e.Id == id);

            BattleShips      = new BattleShips(battleShipsSave);
            Id               = id;
            ShotHitTheTarget = shotHit;
            ContinueOnly     = true;
        }
Exemplo n.º 19
0
 private void RadarDeployment()
 {
     if (!_isRadarDeployment)
     {
         _isRadarDeployment = true;
         BattleShips battleShips = BattleTaskManager.GetBattleShips();
         battleShips.RadarDeployment(isDeploy: true);
     }
 }
        private void PlayLookAtLineAssult()
        {
            KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.SE_056);
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.bufferShipCirlce[0].ForEach(delegate(UIBufferCircle x)
            {
                x.PlayLookAtLine2Assult();
            });
        }
        private void RestoredShip()
        {
            this._uiShipTexture.mainTexture = this._listShipTexture.get_Item(1);
            this._uiShipTexture.MakePixelPerfect();
            this._uiShipTexture.get_transform().set_localPosition(this._listShipOffs.get_Item(1));
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.Restored(this._clsShipModel);
            Dlg.Call(ref this._actOnRestore);
        }
Exemplo n.º 22
0
        private void RestoredShip()
        {
            _uiShipTexture.mainTexture = _listShipTexture[1];
            _uiShipTexture.MakePixelPerfect();
            _uiShipTexture.transform.localPosition = _listShipOffs[1];
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.Restored(_clsShipModel);
            Dlg.Call(ref _actOnRestore);
        }
Exemplo n.º 23
0
        private void RadarDeployment()
        {
            if (this._isRadarDeployment)
            {
                return;
            }
            this._isRadarDeployment = true;
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.RadarDeployment(true);
        }
Exemplo n.º 24
0
        public void BSChangeFromPlayerOneToPlayerTwoAndBackAgain()
        {
            BattleShips battleShipsTest = new BattleShips();

            battleShipsTest.EndTurn();
            Assert.AreEqual(1, battleShipsTest.battleShipCurrentPlayer);
            Assert.AreEqual(0, battleShipsTest.battleShipOppositePlayer);
            battleShipsTest.EndTurn();
            Assert.AreEqual(0, battleShipsTest.battleShipCurrentPlayer);
            Assert.AreEqual(1, battleShipsTest.battleShipOppositePlayer);
        }
Exemplo n.º 25
0
        private static (int x, int y) GetCoordinates(
            BattleShips battleShips,
            int size             = 0,
            bool displayOneBoard = false)
        {
            BattleShipsConsoleUi.WriteBoardStartInstruction();
            BattleShipsConsoleUi.WriteMinMaxInstruction(battleShips.GetBoards()[0], displayOneBoard);
            var(x, y) = BattleShipsConsoleUi.BoardControl(battleShips, size, displayOneBoard);

            return(x, y);
        }
Exemplo n.º 26
0
        private void PlayLookAtLine()
        {
            KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.SE_056);
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.bufferFleetCircle.get_Item(0).PlayRipple();
            battleShips.bufferShipCirlce.get_Item(0).ForEach(delegate(UIBufferCircle x)
            {
                x.PlayLookAtLine();
            });
        }
Exemplo n.º 27
0
        public ShotResult RegisterShot(string location)
        {
            HitLocations.Add(location);
            if (!BattleShips.Any(battleShip => battleShip.Fields.Contains(location)))
            {
                return(ShotResult.Miss);
            }

            var ship = BattleShips.Single(battleShip => battleShip.Fields.Contains(location));

            return(ship.Fields.All(field => HitLocations.Contains(field)) ? ShotResult.Sunk : ShotResult.Hit);
        }
Exemplo n.º 28
0
        private void PlayLineAnimation()
        {
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.bufferShipCirlce[0].ForEach(delegate(UIBufferCircle x)
            {
                x.PlayLineAnimation();
            });
            battleShips.bufferShipCirlce[1].ForEach(delegate(UIBufferCircle x)
            {
                x.PlayLineAnimation();
            });
        }
Exemplo n.º 29
0
        private void CalcInitLineRotation()
        {
            BattleField field       = BattleTaskManager.GetBattleField();
            BattleShips battleShips = BattleTaskManager.GetBattleShips();

            battleShips.bufferShipCirlce[0].ForEach(delegate(UIBufferCircle x)
            {
                x.CalcInitLineRotation(field.dicFleetAnchor[FleetType.Enemy]);
            });
            battleShips.bufferShipCirlce[1].ForEach(delegate(UIBufferCircle x)
            {
                x.CalcInitLineRotation(field.dicFleetAnchor[FleetType.Friend]);
            });
        }
Exemplo n.º 30
0
        private static void SaveGameMenu(BattleShips battleShips, DbContextOptions <ApplicationDbContext> dbOptions)
        {
            var menuSaveGame = new Menu(MenuLevel.LevelBlank);

            menuSaveGame.AddMenuHeader("Do you want to save game?");
            menuSaveGame.AddMenuItem(new MenuItem("Yes", "Y", () =>
            {
                battleShips.SaveGame(dbOptions);

                return("m");
            }));
            menuSaveGame.AddMenuItem(new MenuItem("No", "N", () => "m"));
            menuSaveGame.RunMenu();
        }