using System.Text; using PlotDirector.Companion.Protocol; using PlotDirector.Companion.Protocol.Manuscript; namespace PlotDirector.Companion.Client; // Bounds one live plain-text collection read, not an entire chapter/Word callback. public static class ChapterIdentityRead { public const int MaximumParagraphsPerStep=32; public const double MaximumMillisecondsPerStep=8; public static bool CanContinue(int count,double elapsedMilliseconds)=>countchapterEnd||frames.Length/24>=ChapterFingerprint.MaxParagraphs||outline<1||outline>10) throw new InvalidOperationException("Live Word paragraph boundaries or outline do not match the chapter."); if(WordParagraphIdentity.Normalise(nativeId)!=nativeId||nativeId.Length==0)throw new InvalidOperationException("Complete native paragraph identity is required."); frames.Append(nativeId);frames.Append((end-start).ToString("X8",System.Globalization.CultureInfo.InvariantCulture));frames.Append(outline.ToString("X8",System.Globalization.CultureInfo.InvariantCulture)); return end; } }