Class MultiCost
Cost which is the concatenation of other costs. Can only be paid if all of its costs can be paid, and pays all its costs sequentially.
Assembly: ItemChanger.dll
Syntax
public sealed record MultiCost : Cost, IEquatable<Cost>, IReadOnlyList<Cost>, IReadOnlyCollection<Cost>, IEnumerable<Cost>, IEnumerable, IEquatable<MultiCost>
Constructors
View Source
MultiCost()
Declaration
View Source
MultiCost(params Cost[])
Declaration
public MultiCost(params Cost[] Costs)
Parameters
| Type |
Name |
Description |
| Cost[] |
Costs |
|
View Source
MultiCost(IEnumerable<Cost>)
Declaration
public MultiCost(IEnumerable<Cost> Costs)
Parameters
Properties
View Source
Count
Declaration
public int Count { get; }
Property Value
View Source
DiscountRate
A number between 0 and 1 which modifies numeric costs. Only considered by some costs.
For example, the Leg Eater dung discount sets this to 0.8, to indicate that geo costs should be at 80% price.
Declaration
public override float DiscountRate { get; set; }
Property Value
Overrides
View Source
EqualityContract
Declaration
protected override Type EqualityContract { get; }
Property Value
Overrides
View Source
this[int]
Declaration
public Cost this[int index] { get; }
Parameters
| Type |
Name |
Description |
| int |
index |
|
Property Value
Methods
View Source
CanPay()
Returns whether the cost can currently be paid.
Declaration
public override bool CanPay()
Returns
Overrides
View Source
Contains(Cost)
Declaration
public bool Contains(Cost item)
Parameters
| Type |
Name |
Description |
| Cost |
item |
|
Returns
View Source
CopyTo(Cost[], int)
Declaration
public void CopyTo(Cost[] array, int arrayIndex)
Parameters
| Type |
Name |
Description |
| Cost[] |
array |
|
| int |
arrayIndex |
|
View Source
Equals(Cost?)
Declaration
public override sealed bool Equals(Cost? other)
Parameters
| Type |
Name |
Description |
| Cost |
other |
|
Returns
Overrides
View Source
Equals(MultiCost?)
Declaration
public bool Equals(MultiCost? other)
Parameters
Returns
View Source
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
View Source
GetCostText()
Method which provides the cost text used in y/n prompts.
Declaration
public override string GetCostText()
Returns
Overrides
View Source
GetEnumerator()
Declaration
public IEnumerator<Cost> GetEnumerator()
Returns
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
View Source
HasPayEffects()
Does paying this cost have effects (particularly that could prevent paying other costs of the same type)?
Declaration
public override bool HasPayEffects()
Returns
Overrides
View Source
Includes(Cost)
Is the other cost a subset of this cost?
Declaration
public override bool Includes(Cost c)
Parameters
| Type |
Name |
Description |
| Cost |
c |
|
Returns
Overrides
View Source
IndexOf(Cost)
Declaration
public int IndexOf(Cost item)
Parameters
| Type |
Name |
Description |
| Cost |
item |
|
Returns
View Source
Load()
Method which should be called by the Cost's owner during initial loading. Used by certain costs which require global or shared tracking.
Declaration
public override void Load()
Overrides
View Source
OnPay()
Method for administering all effects of the cost during Pay.
Declaration
public override void OnPay()
Overrides
View Source
PrintMembers(StringBuilder)
Declaration
protected override bool PrintMembers(StringBuilder builder)
Parameters
Returns
Overrides
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
View Source
Unload()
Method which should be called by the Cost's owner during unloading. Used by certain costs which require global or shared tracking.
Declaration
public override void Unload()
Overrides
Operators
View Source
operator ==(MultiCost?, MultiCost?)
Declaration
public static bool operator ==(MultiCost? left, MultiCost? right)
Parameters
Returns
View Source
operator !=(MultiCost?, MultiCost?)
Declaration
public static bool operator !=(MultiCost? left, MultiCost? right)
Parameters
Returns
Implements
Extension Methods