using RecrownedAthenaeum.UI.Modular; namespace RecrownedAthenaeum.UI.Book { /// /// A page a part of a . /// public class Page : UIModuleGroup { private readonly int pageX, pageY; /// /// Whether or not this book needs to be refreshed with new dimensions. /// public bool requiresSizeUpdate; /// /// Constructs a page. /// /// The X position in the book. /// The Y position in the book. public Page(int pageX, int pageY) : base(false) { this.pageX = pageX; this.pageY = pageY; requiresSizeUpdate = true; Name = ToString(); } /// /// Called when this page is flagged as needing a size update. /// /// New width. /// New Height public virtual void ApplySize(int width, int height) { bounds.X = pageX * width; bounds.Y = pageY * height; bounds.Width = width; bounds.Height = height; requiresSizeUpdate = false; } } }