Пример #1
0
 public void addCharacter(Character c)
 {
     foreach (Character ch in chars)
     {
         if (c.charx == ch.charx)
             return;
     }
     chars.Add(c);
 }
Пример #2
0
 public Character MatchCharacter(int charid)
 {
     conn = new System.Data.SQLite.SQLiteConnection(@"Data Source=CoreInkLib.dll");
     conn.Open();
     SQLiteCommand sqc = new SQLiteCommand("SELECT * FROM character WHERE char_id = " + charid+ ";", conn);
     SQLiteDataReader sqr = sqc.ExecuteReader();
     sqr.Read();
     Character c = new Character();
     c.lang = Convert.ToInt32(sqr[2]);
     c.charx = sqr[1].ToString();
     conn.Close();
     return c;
 }
Пример #3
0
 public void LoadData()
 {
     chars = new List<Character>();
     conn = new System.Data.SQLite.SQLiteConnection(@"Data Source=CoreInkLib.dll");
     conn.Open();
     SQLiteCommand sqc = new SQLiteCommand("SELECT * FROM character ORDER BY charx", conn);
     SQLiteDataReader sqr = sqc.ExecuteReader();
     while (sqr.Read())
     {
         Character c = new Character();
         c.charx = sqr[1].ToString();
         SQLiteCommand sqc2 = new SQLiteCommand("SELECT * FROM variant WHERE char_id = " + sqr[0].ToString(), conn);
         SQLiteDataReader sqr2 = sqc2.ExecuteReader();
         while (sqr2.Read())
         {
             Variant v = new Variant();
             SQLiteCommand sqc3 = new SQLiteCommand("SELECT * FROM strokes WHERE vid = " + sqr2[0].ToString(), conn);
             SQLiteDataReader sqr3 = sqc3.ExecuteReader();
             while (sqr3.Read())
             {
                 Stroke s = Int2Stroke(sqr3[3].ToString());
                 s.quadrant = sqr3[4].ToString();
                 v.Strokes.Add(s);
             }
             c.variants.Add(v);
         }
         chars.Add(c);
     }
     conn.Close();
 }
Пример #4
0
 public void removeCharacter(Character c)
 {
     chars.Remove(c);
 }