public List <Carta> recombertirList(List <Dictionary <string, object> > carL) { List <Carta> lisC = new List <Carta>(); foreach (Dictionary <string, object> dic in carL) { Carta car = new Carta(); car.recombertirDat(dic); lisC.Add(car); } this.mano = lisC; return(lisC); }
public Stack <Carta> recombertirStack(Stack <Dictionary <string, object> > sta) { Stack <Carta> staC = new Stack <Carta>(); foreach (Dictionary <string, object> dic in sta) { Carta car = new Carta(); car.recombertirDat(dic); staC.Push(car); //sta.Pop(); } return(staC); }
static void maso_click() { Dictionary <string, object> ter = new Dictionary <string, object>(); ter.Add("Accion", "ObtenerCarta"); ter.Add("Jugador", nombre_usuario); Dictionary <string, object> resp = Cliente.startCliente(ter); if (resp != null) { if ((bool)resp["Objeto"] == true) { Application.Current.Dispatcher.Invoke(new Action(() => { baraja.Children.Remove(list_Images_Maso[list_Images_Maso.Count - 1]); list_Images_Maso.RemoveAt(list_Images_Maso.Count - 1); if (list_Images_Maso.Count != 0) { list_Images_Maso[list_Images_Maso.Count - 1].MouseDown += evento_maso_click; } //mesa.recombertirDat(); mesa.recombertirDat((Dictionary <string, object>)resp["Mesa"]); Carta carta = new Carta(); carta.recombertirDat((Dictionary <string, object>)resp["Carta"]); string tipo = carta.Tipo.ToString(); string simbolo = carta.Simbolo.ToString(); insetar_cartas_Mano(tipo + simbolo); Console.WriteLine("Click Maso"); })); } else { try { if ((string)resp["Mensaje"] == "noTurno") { MessageBox.Show("No es su turno"); } if ((string)resp["Mensaje"] == "mas21") { MessageBox.Show("Te has sobrepasado en los puntos"); } } catch (Exception e) { Console.WriteLine(e.ToString()); } } } }