コード例 #1
0
        public static TitleHue ReadTitleHue(GenericReader reader)
        {
            if (!reader.ReadBool())
            {
                return(null);
            }

            var uid = new TitleObjectSerial(reader);

            TitleHue hue;

            return(HueRegistry.TryGetValue(uid, out hue) ? hue : null);
        }
コード例 #2
0
ファイル: TitleObject.cs プロジェクト: zerodowned/UO-Forever
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

            UID = new TitleObjectSerial(reader);

            switch (version)
            {
            case 0:
                Rarity = reader.ReadFlag <TitleRarity>();
                break;
            }
        }
コード例 #3
0
        public static Title ReadTitle(GenericReader reader)
        {
            if (!reader.ReadBool())
            {
                return(null);
            }

            var uid = new TitleObjectSerial(reader);

            Title title;

            if (TitleRegistry.TryGetValue(uid, out title))
            {
                return(title);
            }

            return(null);
        }
コード例 #4
0
        private static bool DeserializeHueRegistry(GenericReader reader)
        {
            int version = reader.GetVersion();

            switch (version)
            {
            case 0:
            {
                reader.ReadBlockDictionary(
                    () =>
                    {
                        var h = new TitleHue(reader);
                        TitleObjectSerial s = h.UID;

                        return(new KeyValuePair <TitleObjectSerial, TitleHue>(s, h));
                    },
                    HueRegistry);
            }
            break;
            }

            return(true);
        }
コード例 #5
0
ファイル: TitleObject.cs プロジェクト: zerodowned/UO-Forever
        public TitleObject(TitleRarity rarity)
        {
            UID = new TitleObjectSerial();

            Rarity = rarity;
        }
コード例 #6
0
        public static TitleHue ReadTitleHue(GenericReader reader)
        {
            if (!reader.ReadBool())
            {
                return null;
            }

            var uid = new TitleObjectSerial(reader);

            TitleHue hue;

            return HueRegistry.TryGetValue(uid, out hue) ? hue : null;
        }
コード例 #7
0
        public static Title ReadTitle(GenericReader reader)
        {
            if (!reader.ReadBool())
            {
                return null;
            }

            var uid = new TitleObjectSerial(reader);

            Title title;

            if (TitleRegistry.TryGetValue(uid, out title))
            {
                return title;
            }

            return null;
        }