documentation.

This commit is contained in:
2019-01-14 00:34:35 -06:00
parent 32c2f25196
commit 40c7772559
15 changed files with 315 additions and 56 deletions

View File

@@ -6,6 +6,9 @@ using System.Linq;
namespace RecrownedAthenaeum.UI.Book
{
/// <summary>
/// Contains the pages.
/// </summary>
public class Book
{
Camera2D camera;
@@ -25,6 +28,10 @@ namespace RecrownedAthenaeum.UI.Book
this.dimensions = dimensions;
}
/// <summary>
/// Draws the pages.
/// </summary>
/// <param name="batch">Batch used to draw.</param>
public void Draw(SpriteBatch batch)
{
for (int pageIndex = 0; pageIndex < pages.Count; pageIndex++)
@@ -34,6 +41,10 @@ namespace RecrownedAthenaeum.UI.Book
}
}
/// <summary>
/// Updates the book.
/// </summary>
/// <param name="gameTime">Snapshot of information of the game time.</param>
public void Update(GameTime gameTime)
{
if (targetPage != null)
@@ -57,6 +68,10 @@ namespace RecrownedAthenaeum.UI.Book
}
}
/// <summary>
/// Adds the page(s).
/// </summary>
/// <param name="pages">The page(s) to add.</param>
public void AddPages(params Page[] pages)
{
foreach (Page page in pages)
@@ -65,21 +80,37 @@ namespace RecrownedAthenaeum.UI.Book
}
}
/// <summary>
/// Removes the page.
/// </summary>
/// <param name="page">Page to remove.</param>
public void RemovePage(Page page)
{
RemovePage(page.Name);
}
/// <summary>
/// Removes the page.
/// </summary>
/// <param name="name">Name of page to remove.</param>
public void RemovePage(string name)
{
pages.Remove(name);
}
/// <summary>
/// Perform a step of linear interpolation to the given page.
/// </summary>
/// <param name="page">The page to lerp to.</param>
public void LerpToPage(Page page)
{
targetPage = page;
}
/// <summary>
/// Goes to page instantly.
/// </summary>
/// <param name="page">Page to go to.</param>
public void GoToPage(Page page)
{
Rectangle targetBounds = page.bounds;