GenericCraftingRecipePageProvider
A class in Root.Township, the global namespace.
Page provider (ID 2) that draws a generic crafting recipe as a page: result item glyph plus one glyph and count per material. Get it with Instance.
- Listed in Global namespace: E to H
- Inherits or implements
GeneratedPageProvider<GenericCraftingRecipe>
Constructors
| Member | What it is |
|---|---|
GenericCraftingRecipePageProvider() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
1 private and internal field
| Member | What it is |
|---|---|
private GenericCraftingRecipe testRecipe | Recipe used by Test. |
Properties
| Member | What it is |
|---|---|
override int Identifier { get; } | Provider ID, 2. |
static GenericCraftingRecipePageProvider Instance { get; } | The registered provider from PageProvider.Providers[2]. |
Methods
| Member | What it is |
|---|---|
override PageData GeneratePage(GenericCraftingRecipe recipe) | Builds the page from the template, the result item's glyph, the recipe's unique glyphs and a counted glyph per material. |
override PageData GetRandom() | Picks a random recipe (from the simple list on a simple server) and returns its page if not yet found, else null. |
override void Serialize(Stream stream, ref PageData page) | Syncs the page as the recipe hash; the reader rebuilds the page from it. |
protected override void Test() | Editor test: renders testRecipe on the test renderer. |