コード例 #1
0
 public void AddDeck(carddeck newdeck)
 {
     this.decklist.Add(newdeck);
     string[] values = new string[15];
     values[0] = newdeck.name;
     values[1] = newdeck.cardids.Count.ToString();
     values[2] = newdeck.getLeader();
     for (int i = 0; i < ((newdeck.cardids.Count > 12) ? 12 : newdeck.cardids.Count); i++)
     {
         values[3 + i] = newdeck.cardids[i].ToString();
     }
     base.Rows.Add(values);
     this.saveconfig();
 }
コード例 #2
0
 public void UpdateDeck(carddeck newdeck, int index)
 {
     this.decklist[index] = newdeck;
     base.Rows[index][0] = newdeck.name;
     base.Rows[index][1] = newdeck.cardids.Count.ToString();
     base.Rows[index][2] = newdeck.getLeader();
     for (int i = 0; i < 12; i++)
     {
         if (i < newdeck.cardids.Count)
         {
             base.Rows[index][3 + i] = newdeck.cardids[i].ToString();
         }
         else
         {
             base.Rows[index][3 + i] = "";
         }
     }
     this.saveconfig();
 }