Exemplo n.º 1
0
 public Tuple<string, int> AskCard(string restriction)
 {
     return _engine.Invoke<Tuple<string, int>>(() =>
                                                   {
                                                       //fix MAINWINDOW bug
                                                       var dlg = new CardDlg(restriction)
                                                                     {Owner = Program.PlayWindow};
                                                       if (!dlg.ShowDialog().GetValueOrDefault()) return null;
                                                       return Tuple.Create(dlg.SelectedCard.Id.ToString(),
                                                                           dlg.Quantity);
                                                   });
 }
Exemplo n.º 2
0
 //public Tuple<string, int> AskCard(string restriction)
 //{
 //    return _engine.Invoke<Tuple<string, int>>(() =>
 //                                                  {
 //                                                      //fix MAINWINDOW bug
 //                                                      var dlg = new CardDlg(restriction) { Owner = WindowManager.PlayWindow };
 //                                                      if (!dlg.ShowDialog().GetValueOrDefault()) return null;
 //                                                      return Tuple.Create(dlg.SelectedCard.Id.ToString(),
 //                                                                          dlg.Quantity);
 //                                                  });
 //}
 public Tuple<string, int> AskCard(Dictionary<string,string> properties, string op )
 {
     //this.AskCard(x => x.Where(y => y.Name = "a"));
     //default(DataNew.Entities.ICard).Properties.Where(x => x.Key.Name == "Rarity" && x.Value == "Token");
     return _engine.Invoke<Tuple<string, int>>(() =>
                                                   {
                                                       //fix MAINWINDOW bug
                                                       var dlg = new CardDlg(properties,op) { Owner = WindowManager.PlayWindow };
                                                       if (!dlg.ShowDialog().GetValueOrDefault()) return null;
                                                       return Tuple.Create(dlg.SelectedCard.Id.ToString(),
                                                                           dlg.Quantity);
                                                   });
 }