コード例 #1
0
            static partial void FillBinaryAnimationsCustom(MutagenFrame frame, IPackageIdles item)
            {
                byte?count = null;

                for (int i = 0; i < 3; i++)
                {
                    var subRecord = frame.GetSubrecordFrame();
                    if (subRecord.RecordType == RecordTypes.IDLC)
                    {
                        // Counter start
                        if (subRecord.Content.Length != 1)
                        {
                            throw new ArgumentException("Unexpected counter length");
                        }
                        count           = subRecord.Content[0];
                        frame.Position += subRecord.TotalLength;
                    }
                    else if (subRecord.RecordType == RecordTypes.IDLA)
                    {
                        if (count == null)
                        {
                            item.Animations.SetTo(
                                Mutagen.Bethesda.Binary.ListBinaryTranslation <IFormLink <IdleAnimation> > .Instance.Parse(
                                    frame: frame,
                                    triggeringRecord: RecordTypes.IDLA,
                                    transl: FormLinkBinaryTranslation.Instance.Parse));
                        }
                        else
                        {
                            item.Animations.SetTo(
                                Mutagen.Bethesda.Binary.ListBinaryTranslation <IFormLink <IdleAnimation> > .Instance.Parse(
                                    frame: frame,
                                    amount: count.Value,
                                    triggeringRecord: RecordTypes.IDLA,
                                    transl: FormLinkBinaryTranslation.Instance.Parse));
                        }
                    }
                    else if (subRecord.RecordType == RecordTypes.IDLT)
                    {
                        item.TimerSetting = subRecord.Content.Float();
                        frame.Position   += subRecord.TotalLength;
                    }
                    else
                    {
                        break;
                    }
                }
                if (count.HasValue && count.Value != item.Animations.Count)
                {
                    throw new ArgumentException("Idle animation counts did not match.");
                }
            }
コード例 #2
0
 public static partial void FillBinaryTimerSettingCustom(MutagenFrame frame, IPackageIdles item)
 {
     FillBinaryAnimationsCustom(frame, item);
 }