rhythmbullet/RhythmBullet/Zer01HD/Utilities/UI/Book/Book.cs

46 lines
988 B
C#

using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RhythmBullet.Zer01HD.UI.Book
{
class Book
{
Viewport viewport;
Dictionary<string, Page> pages = new Dictionary<string, Page>();
public Book(Viewport viewport)
{
this.viewport = viewport;
}
public void AddPage(Page page)
{
pages.Add(page.Name, page);
}
public void RemovePage(Page page)
{
RemovePage(page.Name);
}
public void RemovePage(string name)
{
pages.Remove(name);
}
public void Resize(int width, int height)
{
viewport.Width = width;
viewport.Height = height;
}
public void DisplayPage(string name)
{
pages[name].DisplayWithViewport(viewport);
}
}
}