Skip to main content

IngredientPageProvider

A class in Root.Township, the global namespace.

Page provider (identifier 6) that generates ingredient pages: an item's glyph, its cooking stage and the effects it gives when eaten. Get it through Instance.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private static Logger loggerLogger for this provider.
private Item testItemItem used by Test.

Properties​

MemberWhat it is
override int Identifier { get; }Always 6, this provider's slot in PageProvider.Providers.
static IngredientPageProvider Instance { get; }The registered ingredient page provider.

Methods​

MemberWhat it is
override PageData GeneratePage(Item item)Builds the page from the settings template, the item glyph, a cooking stage glyph and one glyph with segments per non-zero effect.
override PageData GetRandom()Picks a random cookable item with a prefab. Returns its page if not yet discovered, otherwise null.
override void Serialize(Stream stream, ref PageData page)Sends the page's item as a hash. The reading side rebuilds the page with GeneratePage.
protected override void Test()Editor test: renders the page for testItem.
1 private and internal method
MemberWhat it is
private bool CheckIfCookable(Item item)True when the item has a CookableItem component.