예제 #1
0
        public static void Deserialize(MonsterConfig ins, tabtoy.DataReader reader)
        {
            int tag = -1;

            while (-1 != (tag = reader.ReadTag()))
            {
                switch (tag)
                {
                case 0xa0000:
                {
                    ins.Datas.Add(reader.ReadStruct <MonsterConfigDefine>(MonsterConfigDefineDeserializeHandler));
                }
                break;
                }
            }


            // Build MonsterConfig Index
            for (int i = 0; i < ins.Datas.Count; i++)
            {
                var element = ins.Datas[i];

                ins._ByID.Add(element.ID, element);
            }
        }
예제 #2
0
 public static void Deserialize(MonsterConfig ins, System.IO.Stream stream)
 {
     tabtoy.DataReader reader = new tabtoy.DataReader(stream);
     if (!reader.ReadHeader())
     {
         throw new System.Exception(string.Format("Deserialize failed: {0}", ins.GetType()));
     }
     Deserialize(ins, reader);
 }