예제 #1
0
        public static GlobalShort AddNewShort(this IGroupCommon <Global> globals, string editorId)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(editorId),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
예제 #2
0
        public static GlobalShort AddNewShort(this IGroup <Global> globals)
        {
            var ret = new GlobalShort(
                globals.SourceMod.GetNextFormKey(),
                globals.SourceMod.GameRelease.ToSkyrimRelease());

            globals.Add(ret);
            return(ret);
        }
예제 #3
0
        public static Global CreateFromBinary(
            MutagenFrame frame,
            RecordTypeConverter recordTypeConverter)
        {
            return(GlobalCustomParsing.Create <Global>(
                       frame,
                       getter: (f, triggerChar) =>
            {
                switch (triggerChar)
                {
                case GlobalInt.TRIGGER_CHAR:
                    return GlobalInt.CreateFromBinary(f);

                case GlobalShort.TRIGGER_CHAR:
                    return GlobalShort.CreateFromBinary(f);

                case GlobalFloat.TRIGGER_CHAR:
                    return GlobalFloat.CreateFromBinary(f);

                default:
                    throw new ArgumentException($"Unknown trigger char: {triggerChar}");
                }
            }));
        }