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);
        }
Beispiel #2
0
        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;
            }
        }
        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);
        }
        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);
        }
Beispiel #5
0
        public TitleObject(TitleRarity rarity)
        {
            UID = new TitleObjectSerial();

            Rarity = rarity;
        }
        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;
        }
        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;
        }