Class WorkOrder
An item that represents a work order being performed at a crafting table.
Inheritance
System.Object
WorkOrder
Implements
System.ComponentModel.INotifyPropertyChanged
ISuffixName
Assembly: Eco.Gameplay.dll
Syntax
public class WorkOrder : SimpleEntry, ILinkableParameterized<bool>, ILinkableParameterized<SimpleEntry.NamingOptions>, ILinkable, IValidity, ICachesValidity, INotifyPropertyChanged, IDescribable, ISuffixName, IThreadSafeSubscriptions, ISubscriptions<ThreadSafeSubscriptions>, ISubscriptions, IHasID, IController, IViewController, IHasUniversalID, INamed, IReInitializable, IHasReferenceableSerializableID, IHasSerializableID, ISharedWorkOrder, IHasPosition
Constructors
WorkOrder()
Declaration
WorkOrder(User, Inventory, RecipeFamily, Int32, CraftingComponent)
Declaration
public WorkOrder(User creator, Inventory inventory, RecipeFamily recipe, int quantity, CraftingComponent parent)
Parameters
Fields
AddedIngredients
Declaration
public ThreadSafeList<FractionalItemStack> AddedIngredients
Field Value
CancelledWorkOrderEvent
Declaration
public static ThreadSafeAction<WorkOrder> CancelledWorkOrderEvent
Field Value
MarkerVisibilityDistance
Declaration
public const float MarkerVisibilityDistance = 5F
Field Value
Type |
Description |
System.Single |
|
OnCollected
Declaration
public ThreadSafeAction OnCollected
Field Value
StartedWorkOrderEvent
Declaration
public static ThreadSafeAction<WorkOrder> StartedWorkOrderEvent
Field Value
Properties
AllowAutoselect
Declaration
public bool AllowAutoselect { get; }
Property Value
Type |
Description |
System.Boolean |
|
AllowedLabor
Declaration
public float AllowedLabor { get; }
Property Value
Type |
Description |
System.Single |
|
AllProducts
Declaration
public List<Recipe> AllProducts { get; }
Property Value
Type |
Description |
System.Collections.Generic.List<Recipe> |
|
AutoselectProduct
Declaration
public bool AutoselectProduct { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
AvailableLabor
Declaration
public float AvailableLabor { get; }
Property Value
Type |
Description |
System.Single |
|
Blocked
Declaration
public bool Blocked { get; }
Property Value
Type |
Description |
System.Boolean |
|
BlockedForAwhile
Declaration
public bool BlockedForAwhile { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
BlockingType
Declaration
public CraftingBlockingType BlockingType { get; set; }
Property Value
Byproduct
Declaration
public Item Byproduct { get; }
Property Value
CompletedProducts
Declaration
public ThreadSafeList<ItemStack> CompletedProducts { get; set; }
Property Value
CompletedQuantity
Declaration
public int CompletedQuantity { get; }
Property Value
Type |
Description |
System.Int32 |
|
ContributedCraftTime
Declaration
public ImmutableCountdown ContributedCraftTime { get; }
Property Value
CraftingComponent
Declaration
public CraftingComponent CraftingComponent { get; }
Property Value
CraftingFees
Declaration
public CraftingFees CraftingFees { get; set; }
Property Value
CraftingScrap
Declaration
public ThreadSafeList<FractionalItemStack> CraftingScrap { get; }
Property Value
CraftTime
Declaration
public float CraftTime { get; }
Property Value
Type |
Description |
System.Single |
|
CurrentIteration
Declaration
public int CurrentIteration { get; }
Property Value
Type |
Description |
System.Int32 |
|
CurrentProductName
Declaration
public string CurrentProductName { get; set; }
Property Value
Type |
Description |
System.String |
|
CurrentRecipe
Declaration
public Recipe CurrentRecipe { get; }
Property Value
Declaration
public InventoryCollection DefaultInputInventory { get; }
Property Value
DefaultInventory
Declaration
public InventoryCollection DefaultInventory { get; }
Property Value
DefaultOutputInventory
Declaration
public InventoryCollection DefaultOutputInventory { get; }
Property Value
DescribeNeededSkills
Declaration
public LocString DescribeNeededSkills { get; }
Property Value
DisplayName
Declaration
public LocString DisplayName { get; }
Property Value
Finished
Declaration
public bool Finished { get; }
Property Value
Type |
Description |
System.Boolean |
|
Guid
Declaration
public Guid Guid { get; }
Property Value
Type |
Description |
System.Guid |
|
KnowledgeShare
Declaration
public ControllerHashSet<User> KnowledgeShare { get; set; }
Property Value
LaborAndResourcePercentDoneForIteration
Declaration
public float LaborAndResourcePercentDoneForIteration { get; }
Property Value
Type |
Description |
System.Single |
|
LaborAndResourcePercentDoneTotal
Declaration
public float LaborAndResourcePercentDoneTotal { get; }
Property Value
Type |
Description |
System.Single |
|
LaborFullCost
Declaration
public float LaborFullCost { get; }
Property Value
Type |
Description |
System.Single |
|
LaborOnCurrentIteration
Declaration
public float LaborOnCurrentIteration { get; }
Property Value
Type |
Description |
System.Single |
|
LaborPercentage
Declaration
public float LaborPercentage { get; }
Property Value
Type |
Description |
System.Single |
|
Declaration
public float LaborPerformed { get; }
Property Value
Type |
Description |
System.Single |
|
LaborPerIteration
Declaration
public float LaborPerIteration { get; }
Property Value
Type |
Description |
System.Single |
|
LaborReservationMultiplier
Declaration
public float LaborReservationMultiplier { get; }
Property Value
Type |
Description |
System.Single |
|
LatestContribution
Declaration
public string LatestContribution { get; set; }
Property Value
Type |
Description |
System.String |
|
MissingIngredients
Declaration
public ControllerList<TagStack> MissingIngredients { get; }
Property Value
Declaration
public TagStack[] NeededTags { get; }
Property Value
NeedsLiquid
Declaration
public bool NeedsLiquid { get; }
Property Value
Type |
Description |
System.Boolean |
|
OriginalQuantity
Declaration
public int OriginalQuantity { get; }
Property Value
Type |
Description |
System.Int32 |
|
Owner
Declaration
public User Owner { get; }
Property Value
Position
Declaration
public Vector3 Position { get; }
Property Value
Type |
Description |
System.Numerics.Vector3 |
|
Product
Declaration
public Item Product { get; }
Property Value
Recipe
Declaration
public RecipeFamily Recipe { get; }
Property Value
RecipeFriendlyName
Declaration
public LocString RecipeFriendlyName { get; }
Property Value
RecipeName
Declaration
public string RecipeName { get; }
Property Value
Type |
Description |
System.String |
|
ResourcePercentage
Declaration
public float ResourcePercentage { get; }
Property Value
Type |
Description |
System.Single |
|
State
Declaration
public WorkOrderState State { get; }
Property Value
TimeLeft
Declaration
public double TimeLeft { get; }
Property Value
Type |
Description |
System.Double |
|
TimeOnCurrentIteration
Declaration
public double TimeOnCurrentIteration { get; }
Property Value
Type |
Description |
System.Double |
|
TotalContributedLabor
Declaration
public float TotalContributedLabor { get; }
Property Value
Type |
Description |
System.Single |
|
TotalTime
Declaration
public double TotalTime { get; }
Property Value
Type |
Description |
System.Double |
|
TotalTimeSpent
Declaration
public int TotalTimeSpent { get; }
Property Value
Type |
Description |
System.Int32 |
|
UncraftedQuantity
Declaration
public int UncraftedQuantity { get; }
Property Value
Type |
Description |
System.Int32 |
|
ValidProducts
Declaration
public List<string> ValidProducts { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.List<System.String> |
|
WatchingUsers
Declaration
public ControllerHashSet<User> WatchingUsers { get; set; }
Property Value
WorkParty
Declaration
public WorkParty WorkParty { get; set; }
Property Value
WorldObject
Declaration
public WorldObject WorldObject { get; }
Property Value
Methods
AddIngredientsToCurrentIteration(Player, ItemStack, Int32)
Declaration
public int AddIngredientsToCurrentIteration(Player player, ItemStack stack, int maxToContribute = 2147483647)
Parameters
Type |
Name |
Description |
Player |
player |
|
ItemStack |
stack |
|
System.Int32 |
maxToContribute |
|
Returns
Type |
Description |
System.Int32 |
|
AddIngredientsToCurrentIteration(User, ItemStack, Int32)
Declaration
public int AddIngredientsToCurrentIteration(User user, ItemStack stack, int maxToContribute = 2147483647)
Parameters
Type |
Name |
Description |
User |
user |
|
ItemStack |
stack |
|
System.Int32 |
maxToContribute |
|
Returns
Type |
Description |
System.Int32 |
|
AnyNeededInCurentIteration(ItemStack)
Declaration
public bool AnyNeededInCurentIteration(ItemStack item)
Parameters
Returns
Type |
Description |
System.Boolean |
|
BlockReason()
Declaration
public LocString BlockReason()
Returns
Cancel(Player)
Declaration
public void Cancel(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
ConsumeLiquid(Type, Int32)
Declaration
public int ConsumeLiquid(Type itemType, int amount)
Parameters
Type |
Name |
Description |
System.Type |
itemType |
|
System.Int32 |
amount |
|
Returns
Type |
Description |
System.Int32 |
|
ContributedLabor(User)
Declaration
public bool ContributedLabor(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Type |
Description |
System.Boolean |
|
DescribeLabor(Single)
Declaration
public LocString DescribeLabor(float labor)
Parameters
Type |
Name |
Description |
System.Single |
labor |
|
Returns
Destroyed()
Declaration
public override void Destroyed()
Overrides
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
GetBottleneckType()
Declaration
public WorkOrder.BottleneckType GetBottleneckType()
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
GetMaxIterationsForLaborReservation()
Returns max iterations for which labor may be reserved.
For short crafts (less than Eco.Gameplay.Items.WorkOrder.CraftTimePerLaborReservationUnit) it will have more iterations per LaborReservationMultiplier unit.
For long crafts (greater than or equal to Eco.Gameplay.Items.WorkOrder.CraftTimePerLaborReservationUnit) it will have one iteration per LaborReservationMultiplier unit.
Declaration
public int GetMaxIterationsForLaborReservation()
Returns
Type |
Description |
System.Int32 |
|
GetMaxLaborReservation()
Returns max labor reservation.
Declaration
public float GetMaxLaborReservation()
Returns
Type |
Description |
System.Single |
|
IngredientsRemaningInAllIterations()
Declaration
public IEnumerable<IStack> IngredientsRemaningInAllIterations()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<IStack> |
|
Initialize()
Declaration
public override void Initialize()
Overrides
IsOwner(Player)
Declaration
public bool IsOwner(Player player)
Parameters
Type |
Name |
Description |
Player |
player |
|
Returns
Type |
Description |
System.Boolean |
|
NeededCount(ItemRepresentation, WorkOrder.IterationDesc)
Declaration
public int NeededCount(ItemRepresentation item, WorkOrder.IterationDesc check)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Needs(Item)
Return true if this or a future iteration needs the given item.
Declaration
public bool Needs(Item item)
Parameters
Type |
Name |
Description |
Item |
item |
|
Returns
Type |
Description |
System.Boolean |
|
OnInventoryChanged(User, CraftingComponent)
Declaration
public void OnInventoryChanged(User actor, CraftingComponent craftingComponent)
Parameters
OnLinkedInventoryChange()
Declaration
public void OnLinkedInventoryChange()
OnRemovingDueVerifyFailed()
Declaration
public void OnRemovingDueVerifyFailed()
Declaration
public LocString OwnershipTooltip(bool userIsOwner, bool userHasFullAccess)
Parameters
Type |
Name |
Description |
System.Boolean |
userIsOwner |
|
System.Boolean |
userHasFullAccess |
|
Returns
ParentDisabled()
Declaration
public void ParentDisabled()
PossibleLaborContributeAmount(User, Single, Boolean, out Single)
Declaration
public ValResult<float> PossibleLaborContributeAmount(User user, float contributionMultiplier, bool checkCalAndIngredients, out float requiredCalories)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Single |
contributionMultiplier |
|
System.Boolean |
checkCalAndIngredients |
|
System.Single |
requiredCalories |
|
Returns
RemoveUncrafted()
Declaration
public void RemoveUncrafted()
ScanInventoryAndContribute(User, Inventory, WorkOrderContributionType)
Declaration
public Result ScanInventoryAndContribute(User actor, Inventory inventory, WorkOrderContributionType contributionType)
Parameters
Returns
SendNotification(LocString, Boolean)
Declaration
public void SendNotification(LocString text, bool temporary = false)
Parameters
Type |
Name |
Description |
LocString |
text |
|
System.Boolean |
temporary |
|
SetCurrentProduct(Recipe)
Declaration
public void SetCurrentProduct(Recipe recipe)
Parameters
Type |
Name |
Description |
Recipe |
recipe |
|
Start(Inventory)
Declaration
public void Start(Inventory inventory)
Parameters
StartRecipe(Player, Recipe, BankAccount)
Declaration
public void StartRecipe(Player player, Recipe recipe, BankAccount bankAccount)
Parameters
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
TryToCollectItems(Player)
Declaration
public void TryToCollectItems(Player collector)
Parameters
Type |
Name |
Description |
Player |
collector |
|
TryToContributeLabor(Player, InteractionModifier)
Declaration
public bool TryToContributeLabor(Player player, InteractionModifier modifier)
Parameters
Returns
Type |
Description |
System.Boolean |
|
TryToContributeLabor(User, Single)
Declaration
public Result TryToContributeLabor(User user, float contributionMultiplier = 1F)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Single |
contributionMultiplier |
|
Returns
UILinkContent()
Declaration
public override LocString UILinkContent()
Returns
Overrides
UILinkContent(Boolean)
Declaration
public override LocString UILinkContent(bool iconsOnly)
Parameters
Type |
Name |
Description |
System.Boolean |
iconsOnly |
|
Returns
Overrides
UpdateProduct()
Declaration
public void UpdateProduct()
Verify()
Declaration
Returns
Implements
System.ComponentModel.INotifyPropertyChanged
ISuffixName
Extension Methods