Ejemplo n.º 1
0
        public void recombertirDat(Dictionary <string, object> mes)
        {
            this.jugadores = recombertirList((List <Dictionary <string, object> >)mes["jugadores"]);
            Crupier cru = new Crupier();

            cru.recombertirDat((Dictionary <string, object>)mes["Crupier"]);
            this.Crupier = cru;
            Repartidor rep = new Repartidor();

            rep.recombertirDat((Dictionary <string, object>)mes["Repartidor"]);
            this.Repartidor = rep;
            this.apuesta    = (int)mes["apuesta"];
        }
Ejemplo n.º 2
0
 private static void actualizarCrupier()
 {
     Application.Current.Dispatcher.Invoke(new Action(() =>
     {
         Crupier crup = mesa.Crupier;
         ((WrapPanel)crupier["wpBorder"]).Children.Clear();
         for (int i = 0; i < crup.mano.Count; i++)
         {
             Carta cart     = crup.mano[i];
             string tipo    = cart.Tipo.ToString();
             string simbolo = cart.Simbolo.ToString();
             Border borderImage;
             if (i == crup.mano.Count - 1)
             {
                 borderImage = crearImage(tipo + simbolo, -30, 0, 0, 0, 45, 70);
             }
             else
             {
                 borderImage = crearImage("CartaDetras", -30, 0, 0, 0, 45, 70);
             }
             ((WrapPanel)crupier["wpBorder"]).Children.Add(borderImage);
         }
     }));
 }
Ejemplo n.º 3
0
        private static void agregarCrupier()
        {
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                crupier            = new Dictionary <string, object>();
                Crupier crup       = mesa.Crupier;
                WrapPanel wpBorder = new WrapPanel();
                for (int i = 0; i < crup.mano.Count; i++)
                {
                    Carta cart     = crup.mano[i];
                    string tipo    = cart.Tipo.ToString();
                    string simbolo = cart.Simbolo.ToString();
                    Border borderImage;
                    if (i == crup.mano.Count - 1)
                    {
                        borderImage = crearImage(tipo + simbolo, -30, 0, 0, 0, 45, 70);
                    }
                    else
                    {
                        borderImage = crearImage("CartaDetras", -30, 0, 0, 0, 45, 70);
                    }

                    wpBorder.Children.Add(borderImage);
                }
                StackPanel sp = new StackPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Right
                };
                Grid grid = new Grid()
                {
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    Height = 70
                };
                TextBlock tbNombre = new TextBlock
                {
                    Width               = 150,
                    TextAlignment       = TextAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                    FontSize            = 14,
                    Margin              = new Thickness(10, 0, 10, 0),
                    Text = "Crupier"
                };
                grid.Children.Add(tbNombre);
                sp.Children.Add(grid);
                WrapPanel wpJugador = new WrapPanel()
                {
                    HorizontalAlignment = HorizontalAlignment.Right,
                    VerticalAlignment   = VerticalAlignment.Top,
                    Margin = new Thickness(0, 5, 0, 5)
                };
                wpJugador.Children.Add(wpBorder);
                wpJugador.Children.Add(sp);

                spJugador.Children.Add(wpJugador);

                crupier.Add("wpJugador", wpJugador);
                crupier.Add("wpBorder", wpBorder);
            }));
            //spJugador.Children.Add();
        }