Skip to main content

ChiselDefinition

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​

MemberWhat it is
ChiselDefinition()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

MemberWhat it is
const int EmptyScoreWeight (2500) for getting no result when picking with GetBest.
Glyph recipeGlyphGlyph shown for this recipe.
const int ShardCountNumber of outer shards (12).
const int UndonePenaltyError added per shard missing from the chiselled order (5).
4 private and internal fields
MemberWhat it is
private bool btnRandomizeInspector button that shuffles chiselOrder.
private List<int> chiselOrderBacking field for ChiselOrder: the order the 12 outer pieces should be chiselled in to get this result.
private PrefabSpawnPosition[] prefabsBacking field for Prefabs: what spawns on the block, and where, when this definition is the result.
private ChiselBlockSize sizeBacking field for Size. Only definitions of the block's size are considered.

Properties​

MemberWhat 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​

MemberWhat 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: