Ejemplo n.º 1
0
 private void InitializeSecret()
 {
     secret = SecretField.GetRandomSecret();
 }
Ejemplo n.º 2
0
        private void DrawSecret()
        {
            int secretX;
            int secretY;

            if (secret != null)
            {
                secretX = (int)secret.CurrentPosition.X;
                secretY = (int)secret.CurrentPosition.Y;
            }
            else
            {
                secretX = 0;
                secretY = 0;
            }

            InitializeSecret();

            secret.CurrentPosition = new Point(secretX, secretY);

            Border secretField;
            if (isFirstSecret)
            {
                isFirstSecret = false;
                secretField = (Border)this.Playfield.FindName("Unit20");
                secretField.Child = null;
            }
            else
            {
                secretField = (Border)this.Playfield.FindName("Unit" + secret.CurrentPosition.Y + secret.CurrentPosition.X);
                secretField.Child = null;
            }

            secret = SecretField.GenerateSecret();

            secretField = (Border)this.Playfield.FindName("Unit" + secret.CurrentPosition.Y + secret.CurrentPosition.X);
            secretField.Child = secret.SmallImage;
            }
Ejemplo n.º 3
0
        private void ResetState()
        {
            foreach (var item in this.Playfield.Children)
            {
                (item as Border).Child = new Image();
            }

            SelectedUnit = null;
            secret = null;

            InitializedTeams.AllianceTeam = new List<RaceAlliance>
            {
                new AllianceSquire(new Point(0, 6)),
                new AllianceSquire(new Point(1, 6)),
                new AllianceSquire(new Point(2, 6)),
                new AllianceSquire(new Point(3, 6)),
                new AllianceSquire(new Point(4, 6)),
                new AllianceSquire(new Point(5, 6)),
                new AllianceSquire(new Point(6, 6)),
                new AllianceSquire(new Point(7, 6)),
                new AllianceMage(new Point(1, 7)),
                new AllianceMage(new Point(6, 7)),
                new AllianceCaptain(new Point(2, 7)),
                new AllianceCaptain(new Point(5, 7)),
                new AllianceWarGolem(new Point(0, 7)),
                new AllianceWarGolem(new Point(7, 7)),
                new AlliancePriest(new Point(3, 7)),
                new AllianceKing(new Point(4, 7)),
            };

            InitializedTeams.HordeTeam = new List<RaceHorde>
            {
                new HordeGrunt(new Point(0, 1)),
                new HordeGrunt(new Point(1, 1)),
                new HordeGrunt(new Point(2, 1)),
                new HordeGrunt(new Point(3, 1)),
                new HordeGrunt(new Point(4, 1)),
                new HordeGrunt(new Point(5, 1)),
                new HordeGrunt(new Point(6, 1)),
                new HordeGrunt(new Point(7, 1)),
                new HordeWarlock(new Point(1, 0)),
                new HordeWarlock(new Point(6, 0)),
                new HordeCommander(new Point(2, 0)),
                new HordeCommander(new Point(5, 0)),
                new HordeDemolisher(new Point(0, 0)),
                new HordeDemolisher(new Point(7, 0)),
                new HordeShaman(new Point(3, 0)),
                new HordeWarchief(new Point(4, 0)),
            };

            isMouseCapture = false;
            mouseXOffset = 0;
            mouseYOffset = 0;
            translateTransform = new TranslateTransform();
            backgroundMusic = new MediaPlayer();
            isSomeUnitSelected = false;
            selectedBorder = new Border();
            turn = true;
        }
Ejemplo n.º 4
0
 private void DrawSecretInfo(SecretField secret)
     {
     SetSecretInfo();
     RemoveSecretInfo();
 }