diff --git a/RecrownedAthenaeum/UI/Book/Book.cs b/RecrownedAthenaeum/UI/Book/Book.cs index 18e7a46..071b54d 100644 --- a/RecrownedAthenaeum/UI/Book/Book.cs +++ b/RecrownedAthenaeum/UI/Book/Book.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using RecrownedAthenaeum.Camera; +using RecrownedAthenaeum.ContentSystem; using System.Collections.Generic; using System.Linq; @@ -11,11 +12,21 @@ namespace RecrownedAthenaeum.UI.Book /// public class Book { + readonly ContentManagerController assets; Camera2D camera; Page targetPage; Rectangle dimensions; Dictionary pages = new Dictionary(); + /// + /// Creates a book. + /// + /// that holds the assets that are to be used in the pages for this book during initialization. + public Book(ContentManagerController assets) + { + this.assets = assets; + } + /// /// Should be called whenever a valid camera and dimensions for the book exist. /// Initializes book with given parameters. @@ -76,7 +87,7 @@ namespace RecrownedAthenaeum.UI.Book { foreach (Page page in pages) { - page.Initialize(); + page.Initialize(assets); this.pages.Add(page.Name, page); } } diff --git a/RecrownedAthenaeum/UI/Book/Page.cs b/RecrownedAthenaeum/UI/Book/Page.cs index c27670e..488f244 100644 --- a/RecrownedAthenaeum/UI/Book/Page.cs +++ b/RecrownedAthenaeum/UI/Book/Page.cs @@ -1,4 +1,5 @@ -using RecrownedAthenaeum.UI.Modular; +using RecrownedAthenaeum.ContentSystem; +using RecrownedAthenaeum.UI.Modular; namespace RecrownedAthenaeum.UI.Book { @@ -43,7 +44,8 @@ namespace RecrownedAthenaeum.UI.Book /// /// Called only once after a page is added to a . Generally used to instantiate the modules of the page. /// - protected internal virtual void Initialize() + /// The assets to be used during initialization passed by the book this page belongs to. + protected internal virtual void Initialize(ContentManagerController assets) { }