Example #1
0
            public static ConditionBinaryOverlay ConditionFactory(OverlayStream stream, BinaryOverlayFactoryPackage package)
            {
                var subRecMeta = stream.GetSubrecordFrame();

                if (subRecMeta.RecordType != RecordTypes.CTDA)
                {
                    throw new ArgumentException();
                }
                Condition.Flag flag = ConditionBinaryCreateTranslation.GetFlag(subRecMeta.Content[0]);
                if (flag.HasFlag(Condition.Flag.UseGlobal))
                {
                    return(ConditionGlobalBinaryOverlay.ConditionGlobalFactory(stream, package));
                }
                else
                {
                    return(ConditionFloatBinaryOverlay.ConditionFloatFactory(stream, package));
                }
            }
Example #2
0
        public static Condition CreateFromBinary(
            MutagenFrame frame,
            RecordTypeConverter?recordTypeConverter)
        {
            if (!frame.Reader.TryGetSubrecord(Mutagen.Bethesda.Fallout4.Internals.RecordTypes.CTDA, out var subRecMeta))
            {
                throw new ArgumentException();
            }
            var flagByte = frame.GetUInt8(subRecMeta.HeaderLength);

            Condition.Flag flag = ConditionBinaryCreateTranslation.GetFlag(flagByte);
            if (flag.HasFlag(Condition.Flag.UseGlobal))
            {
                return(ConditionGlobal.CreateFromBinary(frame.SpawnWithLength(subRecMeta.ContentLength, checkFraming: false)));
            }
            else
            {
                return(ConditionFloat.CreateFromBinary(frame.SpawnWithLength(subRecMeta.ContentLength, checkFraming: false)));
            }
        }
Example #3
0
 private Condition.Flag GetFlagsCustom(int location) => ConditionBinaryCreateTranslation.GetFlag(_data.Span[location]);