Skip to main content

GenericCraftingProject

A class in Root.Township, Alta.Crafting.

The project in progress on a GenericCraftingStation: the recipe's pieces grouped into levels, where each level unlocks once the one before is complete.

Constructors​

MemberWhat it is
GenericCraftingProject(GenericCraftingStation station, GenericCraftingRecipe recipe)Creates a GenericCraftingProject from station and recipe.

Fields​

2 private and internal fields
MemberWhat it is
private GenericCraftingPiece[][] levelledPiecesThe pieces, grouped by level.
private static Logger loggerNLog logger for this class.

Properties​

MemberWhat it is
int CurrentLevel { get; set; }The level currently being filled.
bool IsComplete { get; set; }True once every piece on the last level is complete.
Dictionary<int, GenericCraftingPiece> MappedPieces { get; private set; }All the project's pieces, keyed by piece hash.
GenericCraftingRecipe Recipe { get; private set; }The recipe being built.
GenericCraftingStation Station { get; private set; }The station this project is on.

Methods​

10 private and internal methods
MemberWhat it is
private bool Alta.Crafting.IProject.CanRemoveAtLevel(int level)Whether a piece at the given level can be taken out, given the current level and whether the next level has anything in it.
private void Alta.Crafting.IProject.Clear(bool isReturningMaterials)Clears every piece, spawning refuse for filled pieces if materials are being returned.
private void Alta.Crafting.IProject.Fail(int hash, bool isCritical)Empties a failed piece and plays its destroy effect. A critical fail can also pop other pieces on that level.
private void Alta.Crafting.IProject.ReevaluateLevel()Works out the current level from which pieces are complete, enabling or disabling pieces to match.
private void Alta.Crafting.IProject.SetMaxLevel()Sets the current level to the last one.
private void Alta.Crafting.IProject.SetPieceComplete(int hash, IPlayer complettingPlayer)Marks progress after a piece completes. Unlocks the next level, or completes the project and counts it for tasks.
private void Alta.Crafting.IProject.SetupResult(GenericCraftingResult result)Copies each piece's material onto the matching part of the crafted result.
private void Alta.Crafting.IProject.SyncDestroyEffect(IPlayer player, Stream stream, int pieceIndex)Network sync for a piece's destroy effect. Clients play it when they read it.
private void Alta.Crafting.IProject.SyncPiece(IPlayer player, Stream stream, int pieceIndex)Network sync of one piece's state, by piece hash.
private void Alta.Crafting.IProject.UpdateRenderers(int rangeLevel)Passes the viewer's distance level to every piece so it can update its renderers.

Used in​

Members of other types that take, return or hold a GenericCraftingProject: