Skip to main content

ChiselRecipePageProvider

A class in Root.Township, the global namespace.

Page provider (id 4) that makes recipe pages for chisel shapes, built from ChiselRecipePageSettings. Get it with Instance.

Constructors​

MemberWhat it is
ChiselRecipePageProvider()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private ChiselDefinition testRecipeRecipe used by Test.

Properties​

MemberWhat it is
override int Identifier { get; }Provider id, always 4.
static ChiselRecipePageProvider Instance { get; }The registered provider with id 4.

Methods​

MemberWhat it is
override PageData GeneratePage(ChiselDefinition chiselDefinition)Builds a page from the template, one wood block and size bracket glyph per size step, and the recipe's icon.
override PageData GetRandom()Picks a random chisel recipe and returns its page if the server hasn't handed it out yet, otherwise null.
override void Serialize(Stream stream, ref PageData page)Writes the page's chisel definition by hash, or reads one and regenerates the page.
protected override void Test()Editor test: shows the page for testRecipe on the test renderer.