Example #1
0
 public static void Deserialize(MapConfigDefine 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);
 }
Example #2
0
        public MapConfigDefine GetByID(int ID, MapConfigDefine def = default(MapConfigDefine))
        {
            MapConfigDefine ret;

            if (_ByID.TryGetValue(ID, out ret))
            {
                return(ret);
            }

            if (def == default(MapConfigDefine))
            {
                TableLogger.ErrorLine("GetByID failed, ID: {0}", ID);
            }

            return(def);
        }
Example #3
0
        public static void Deserialize(MapConfigDefine ins, tabtoy.DataReader reader)
        {
            int tag = -1;

            while (-1 != (tag = reader.ReadTag()))
            {
                switch (tag)
                {
                case 0x10000:
                {
                    ins.ID = reader.ReadInt32();
                }
                break;

                case 0x10001:
                {
                    ins.Type = reader.ReadInt32();
                }
                break;

                case 0x60002:
                {
                    ins.Name = reader.ReadString();
                }
                break;

                case 0x60003:
                {
                    ins.Path = reader.ReadString();
                }
                break;

                case 0x60004:
                {
                    ins.BuilderName = reader.ReadString();
                }
                break;

                case 0x60005:
                {
                    ins.Loading.Add(reader.ReadString());
                }
                break;
                }
            }
        }