예제 #1
0
 public static LayoutInfoKey GetKeyFromString(string s)
 {
     string[] ss = s.Split('-');
     if (ss.Length == 2)
     {
         LayoutInfoKey key = LayoutInfoKey.GenerateKey(int.Parse(ss[0]), int.Parse(ss[1]));
         return(key);
     }
     return(null);
 }
예제 #2
0
    public override bool Equals(object obj)
    {
        if (!(obj is LayoutInfoKey) || obj == null)
        {
            return(false);
        }

        LayoutInfoKey key = obj as LayoutInfoKey;

        return(key.Chapter == Chapter && key.Level == Level);
    }
예제 #3
0
 public LayoutInfo this[string index]
 {
     get
     {
         LayoutInfoKey s = GetKeyFromString(index);
         if (mCardDictionary.ContainsKey(s))
         {
             return(mCardDictionary[s]);
         }
         return(null);
     }
 }
예제 #4
0
    void Read()
    {
        Hashtable tb = new Hashtable();

        ParseData(table, tb);
        foreach (DictionaryEntry t in tb)
        {
            LayoutInfo    info  = new LayoutInfo();
            LayoutInfoKey key   = new LayoutInfoKey();
            Hashtable     value = (Hashtable)t.Value;
            info.Chapter  = ParseTableValueToInt(value["Chapter"]);
            key.Chapter   = info.Chapter;
            info.Level    = ParseTableValueToInt(value["Level"]);
            key.Level     = info.Level;
            info.Star1    = ParseTableValueToInt(value["Star1"]);
            info.Star2    = ParseTableValueToInt(value["Star2"]);
            info.Star3    = ParseTableValueToInt(value["Star3"]);
            info.OpenStar = ParseTableValueToInt(value["OpenStar"]);
            info.Cost     = ParseTableValueToInt(value["Cost"]);
            mCardDictionary.Add(key, info);
        }
    }
 void Read()
 {
     Hashtable tb = new Hashtable();
     ParseData(table, tb);
     foreach (DictionaryEntry t in tb)
     {
         LayoutInfo info = new LayoutInfo();
         LayoutInfoKey key = new LayoutInfoKey();
         Hashtable value = (Hashtable)t.Value;
         info.Chapter = ParseTableValueToInt(value["Chapter"]);
         key.Chapter = info.Chapter;
         info.Level = ParseTableValueToInt(value["Level"]);
         key.Level = info.Level;
         info.Star1 = ParseTableValueToInt(value["Star1"]);
         info.Star2 = ParseTableValueToInt(value["Star2"]);
         info.Star3 = ParseTableValueToInt(value["Star3"]);
         info.OpenStar = ParseTableValueToInt(value["OpenStar"]);
         info.Cost = ParseTableValueToInt(value["Cost"]);
         mCardDictionary.Add(key, info);
     }
 }