Example #1
0
        private void SavedList_ItemClick(object sender, ItemClickEventArgs e)
        {
            VMTank tank = e.ClickedItem as VMTank;

            int aux = selectedTank.Id;

            if (aux != tank.Id)
            {
                selectedTank        = ListaTanques[tank.Id];
                TanqueImagen.Source = selectedTank.Img.Source;

                VitBar.Value   = selectedTank.HP + selectedPieza.HP;
                AtkBar.Value   = selectedTank.Atk + selectedPieza.Atk;
                DefBar.Value   = selectedTank.Def + selectedPieza.Def;
                VelBar.Value   = selectedTank.Spe + selectedPieza.Spe;
                MovBar.Value   = selectedTank.Mov + selectedPieza.Mov;
                Habilidad.Text = selectedTank.Habilidad;

                int i = 0;
                while (team[i].Id != aux)
                {
                    ++i;
                }

                team[i] = tank;
            }
        }
Example #2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     for (int i = 0; i < contentControls.Capacity; i++)
     {
         Image img = new Image();
         img.Width  = 60;
         img.Height = 60;
         img.Source = ListaTanques[i].Img.Source;
         canvasTanques.Children.Add(ListaTanques[i].panel);
         ListaTanques[i].CCImg.PointerPressed += SelectTank;
         contentControls.Add(ListaTanques[i].CCImg);
         ListaTanques[i].Img.CenterPoint = new System.Numerics.Vector3(.5f, .5f, .5f);
         if (ListaTanques[i].side == Tank.Side.Enemy)
         {
             ListaTanques[i].Img.Scale = new System.Numerics.Vector3(ListaTanques[i].Img.Scale.X * -1
                                                                     , ListaTanques[i].Img.Scale.Y, ListaTanques[i].Img.Scale.Z);
         }
         Canvas.SetTop(ListaTanques[i].panel, ListaTanques[i].Y);
         if (ListaTanques[i].side == Tank.Side.Enemy)
         {
             Canvas.SetLeft(ListaTanques[i].CCImg, ListaTanques[i].X + ListaTanques[i].Img.Width / 2);
             ListaTanques[i].pb.Scale = new System.Numerics.Vector3(ListaTanques[i].pb.Scale.X * -1
                                                                    , ListaTanques[i].pb.Scale.Y, ListaTanques[i].pb.Scale.Z);
         }
         Canvas.SetLeft(ListaTanques[i].panel, ListaTanques[i].X);
     }
     selectedTank = ListaTanques[0];
 }
Example #3
0
        private void Tank2_Checked(object sender, RoutedEventArgs e)
        {
            Tank1.IsChecked = false;
            Tank0.IsChecked = false;
            Tank3.IsChecked = false;

            selectedTank           = ListaTanques[2];
            GarageButton.IsEnabled = true;
        }
Example #4
0
        private void SelectTank(object sender, PointerRoutedEventArgs e)
        {
            VMTank s = ListaTanques[contentControls.IndexOf(sender as ContentControl)];

            selectedTank = s;
            AtkBar.Value = s.Atk;
            DefBar.Value = s.Def;
            SpeBar.Value = s.Spe;
            MovBar.Value = s.Mov;
        }
Example #5
0
        private void ArrowLeft_Click(object sender, RoutedEventArgs e)
        {
            selectedTank        = team[(team.IndexOf(selectedTank) + 3) % 4];
            TanqueImagen.Source = selectedTank.Img.Source;

            VitBar.Value   = selectedTank.HP + selectedPieza.HP;
            AtkBar.Value   = selectedTank.Atk + selectedPieza.Atk;
            DefBar.Value   = selectedTank.Def + selectedPieza.Def;
            VelBar.Value   = selectedTank.Spe + selectedPieza.Spe;
            MovBar.Value   = selectedTank.Mov + selectedPieza.Mov;
            Habilidad.Text = selectedTank.Habilidad;
        }
Example #6
0
        public BirdView()
        {
            this.InitializeComponent();
            ApplicationView.PreferredLaunchViewSize      = new Size(Height = 432, Width = 768);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            if (ListaTanques != null)
            {
                foreach (Tank tank in model.GetAllTanks())
                {
                    VMTank VMitem = new VMTank(tank);
                    ListaTanques.Add(VMitem);
                }
            }
        }
Example #7
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            BackButton.IsEnabled = this.Frame.CanGoBack;

            if (e.Parameter != null && e.Parameter is int)
            {
                selectedTank = ListaTanques[(int)e.Parameter];
            }
            else
            {
                selectedTank = ListaTanques[0];
            }
            base.OnNavigatedTo(e);

            vit = selectedTank.HP;
            atk = selectedTank.Atk;
            def = selectedTank.Def;
            vel = selectedTank.Spe;
            mov = selectedTank.Mov;

            CanonButton.IsChecked = true;
            Habilidad.Text        = selectedTank.Habilidad;
        }
Example #8
0
        public Garage()
        {
            this.InitializeComponent();
            ApplicationView.PreferredLaunchViewSize      = new Size(Height = 432, Width = 768);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            KeyboardAccelerator GoBack = new KeyboardAccelerator();

            GoBack.Key      = VirtualKey.GoBack;
            GoBack.Invoked += BackInvoked;
            KeyboardAccelerator AltLeft = new KeyboardAccelerator();

            AltLeft.Key      = VirtualKey.Left;
            AltLeft.Invoked += BackInvoked;
            this.KeyboardAccelerators.Add(GoBack);
            this.KeyboardAccelerators.Add(AltLeft);
            // ALT routes here
            AltLeft.Modifiers = VirtualKeyModifiers.Menu;

            if (ListaTanques != null)
            {
                foreach (Tank tank in model.GetAllTanks())
                {
                    VMTank VMitem = new VMTank(tank);
                    ListaTanques.Add(VMitem);
                }
            }

            if (ListaPiezas != null)
            {
                foreach (Pieza pieza in model.GetAllPiezas())
                {
                    VMPieza VMitem = new VMPieza(pieza);
                    ListaPiezas.Add(VMitem);
                }
            }

            if (ListaCanon != null)
            {
                foreach (Pieza pieza in model.GetAllPiezas())
                {
                    VMPieza VMitem = new VMPieza(pieza);

                    if (VMitem.Tipo == Pieza.Type.Null)
                    {
                        nullPieza = VMitem;
                    }

                    if (VMitem.Tipo == Pieza.Type.Canon)
                    {
                        ListaCanon.Add(VMitem);
                    }
                }
            }

            if (ListaBlindaje != null)
            {
                foreach (Pieza pieza in model.GetAllPiezas())
                {
                    VMPieza VMitem = new VMPieza(pieza);
                    if (VMitem.Tipo == Pieza.Type.Blindaje)
                    {
                        ListaBlindaje.Add(VMitem);
                    }
                }
            }

            if (ListaRuedas != null)
            {
                foreach (Pieza pieza in model.GetAllPiezas())
                {
                    VMPieza VMitem = new VMPieza(pieza);
                    if (VMitem.Tipo == Pieza.Type.Ruedas)
                    {
                        ListaRuedas.Add(VMitem);
                    }
                }
            }

            selectedPieza = nullPieza;

            for (int i = 0; i < 4; ++i)
            {
                team.Add(ListaTanques[i]);
            }
        }