A class in Root.Township, Alta.Carpentry.
A chiselling recipe under Carpentry/Chisel Definitions: the order the 12 outer shards are removed in, the block size and the prefabs it makes. Also a recipe page (IPageBasis).
Constructors
| Member | What it is |
|---|
ChiselDefinition() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
| Member | What it is |
|---|
const int EmptyScore | Weight (2500) for getting no result when picking with GetBest. |
Glyph recipeGlyph | Glyph shown for this recipe. |
const int ShardCount | Number of outer shards (12). |
const int UndonePenalty | Error added per shard missing from the chiselled order (5). |
4 private and internal fields
| Member | What it is |
|---|
private bool btnRandomize | Inspector button that shuffles chiselOrder. |
private List<int> chiselOrder | Backing field for ChiselOrder: the order the 12 outer pieces should be chiselled in to get this result. |
private PrefabSpawnPosition[] prefabs | Backing field for Prefabs: what spawns on the block, and where, when this definition is the result. |
private ChiselBlockSize size | Backing field for Size. Only definitions of the block's size are considered. |
Properties
| Member | What it is |
|---|
List<int> ChiselOrder { get; } | The 12 shard indexes in the order this recipe removes them. |
PrefabSpawnPosition[] Prefabs { get; } | Prefabs (with positions) spawned as the result. |
ChiselBlockSize Size { get; } | Block size this recipe needs. |
Methods
| Member | What it is |
|---|
PageData CreatePage(int preferredProvider) | Builds the recipe page for this definition. |
static ChiselDefinition GetBest(List<int> chisellingOrder, ChiselBlockSize size) | Picks a recipe for a chiselled order and size. An exact match wins; else a weighted random pick where worse matches weigh more. |
uint GetHash() | The definition's hash. |
int GetProviderID(int preferredProvider) | The chisel recipe page provider's identifier. |
protected override void OnValidate() | Resets chiselOrder to 0 to 11 when it doesn't have 12 entries, and shuffles it when the Randomize button is pressed. |
Used in
Members of other types that take, return or hold a ChiselDefinition: