Beispiel #1
0
 internal static Comparison <MonoCardInDeckManager> comparisonOfCard()
 {
     return((left, right) =>
     {
         return CardsManager.comparisonOfCard()(left.cardData, right.cardData);
     });
 }
 internal static void initialize(string databaseFullPath)
 {
     using (SqliteConnection connection = new SqliteConnection("Data Source=" + databaseFullPath))
     {
         connection.Open();
         using (IDbCommand command = new SqliteCommand("SELECT pack.* FROM pack;", connection))
         {
             using (IDataReader reader = command.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     try
                     {
                         int  Id = (int)reader.GetInt64(0);
                         Card c  = CardsManager.GetCardRaw(Id);
                         if (c != null)
                         {
                             c.packShortNam = reader.GetString(1);
                             c.packFullName = reader.GetString(2);
                             c.reality      = reader.GetString(3);
                             string   temp = reader.GetString(4);
                             string[] mats = temp.Split("/");
                             if (mats.Length == 3)
                             {
                                 c.month = int.Parse(mats[0]);
                                 c.day   = int.Parse(mats[1]);
                                 c.year  = int.Parse(mats[2]);
                             }
                             if (!pacDic.ContainsKey(c.packFullName))
                             {
                                 pacDic.Add(c.packFullName, c.packShortNam);
                                 packName p = new packName();
                                 p.day       = c.day;
                                 p.year      = c.year;
                                 p.month     = c.month;
                                 p.fullName  = c.packFullName;
                                 p.shortName = c.packShortNam;
                                 packs.Add(p);
                             }
                         }
                     }
                     catch (Exception)
                     {
                     }
                 }
             }
         }
     }
 }
Beispiel #3
0
 public static Card Get(int id)
 {
     return(CardsManager.GetCard(id));
 }