Ejemplo n.º 1
0
        public static void Deserialize(DemoDefine ins, tabtoy.DataReader reader)
        {
            int tag = -1;

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

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

                case 0x50002:
                {
                    ins.HP = reader.ReadFloat();
                }
                break;

                case 0x10003:
                {
                    ins.Skills.Add(reader.ReadInt32());
                }
                break;
                }
            }
        }
Ejemplo n.º 2
0
        public DemoDefine GetDemoByName(string Name, DemoDefine def = default(DemoDefine))
        {
            DemoDefine ret;

            if (_DemoByName.TryGetValue(Name, out ret))
            {
                return(ret);
            }

            if (def == default(DemoDefine))
            {
                TableLogger.ErrorLine("GetDemoByName failed, Name: {0}", Name);
            }

            return(def);
        }
Ejemplo n.º 3
0
        public DemoDefine GetDemoByID(int ID, DemoDefine def = default(DemoDefine))
        {
            DemoDefine ret;

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

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

            return(def);
        }