예제 #1
0
        private void QuickGameAgainstTwo()
        {
            var fieldSize  = PreferencesManager.Instance.GamePreferences.GameFieldSize;
            var baseDist   = PreferencesManager.Instance.GamePreferences.GameBaseDistance;
            var turnLength = PreferencesManager.Instance.GamePreferences.GameTurnLength;
            var players    = new List <IKlopPlayer>
            {
                new KlopPlayer
                {
                    BasePosX = baseDist,
                    BasePosY = fieldSize / 2 - 1,
                    Color    = Colors.Blue,
                    Human    = true,
                    Name     = "You"
                },
                new KlopAiPlayerAllowDisconnected
                {
                    BasePosX = fieldSize - baseDist - 1,
                    BasePosY = baseDist,
                    Color    = Colors.Red,
                    Name     = "Луноход 1"
                },
                new KlopAiPlayerAllowDisconnected
                {
                    BasePosX = fieldSize - baseDist - 1,
                    BasePosY = fieldSize - baseDist - 1,
                    Color    = Colors.Green,
                    Name     = "Луноход 2"
                },
            };

            GameViewModel = new KlopGameViewModel(fieldSize, fieldSize, players, turnLength);
            IsMenuVisible = false;
        }
예제 #2
0
        private void ShowDemo()
        {
            var fieldSize  = PreferencesManager.Instance.GamePreferences.GameFieldSize;
            var baseDist   = PreferencesManager.Instance.GamePreferences.GameBaseDistance;
            var turnLength = PreferencesManager.Instance.GamePreferences.GameTurnLength;
            var players    = new List <IKlopPlayer>
            {
                new KlopAiPlayer
                {
                    BasePosX  = baseDist,
                    BasePosY  = fieldSize - baseDist - 1,
                    Color     = Colors.Red,
                    Name      = "Луноход 1",
                    TurnDelay = TimeSpan.FromSeconds(0.3)
                },
                //new KlopAiPlayer {BasePosX = baseDist, BasePosY = baseDist, Color = Colors.Green, Name = "Луноход 2"},
                //new KlopAiPlayer {BasePosX = fieldSize - baseDist - 1, BasePosY = fieldSize - baseDist - 1, Color = Colors.Yellow, Name = "Луноход 3"},
                new KlopAiPlayer
                {
                    BasePosX  = fieldSize - baseDist - 1,
                    BasePosY  = baseDist,
                    Color     = Colors.Blue,
                    Name      = "Луноход 4",
                    TurnDelay = TimeSpan.FromSeconds(0.3)
                }
            };

            GameViewModel = new KlopGameViewModel(fieldSize, fieldSize, players, turnLength);
            IsMenuVisible = false;
        }
예제 #3
0
        private void QuickGameAgainstHuman()
        {
            var fieldSize  = PreferencesManager.Instance.GamePreferences.GameFieldSize;
            var baseDist   = PreferencesManager.Instance.GamePreferences.GameBaseDistance;
            var turnLength = PreferencesManager.Instance.GamePreferences.GameTurnLength;
            var players    = new List <IKlopPlayer>
            {
                new KlopPlayer
                {
                    BasePosX = baseDist,
                    BasePosY = fieldSize - baseDist - 1,
                    Color    = Colors.Blue,
                    Human    = true,
                    Name     = "Player 1"
                },
                new KlopPlayer
                {
                    BasePosX = fieldSize - baseDist - 1,
                    BasePosY = baseDist,
                    Color    = Colors.Red,
                    Human    = true,
                    Name     = "Player 2"
                },
            };

            GameViewModel = new KlopGameViewModel(fieldSize, fieldSize, players, turnLength);
            IsMenuVisible = false;
        }