Struct Cost
Represents any kind of cost / price in the game. Supports all currencies in the game; gold, dream dust, stardust, health sacrifice and platinum coin.
Assembly: Dew.Core.dll
Syntax
[Serializable]
public struct Cost
Fields
dreamDust
Declaration
Field Value
gold
Declaration
Field Value
healthPercentage
Declaration
public int healthPercentage
Field Value
platinumCoin
Declaration
Field Value
stardust
Declaration
Field Value
Methods
CanAfford(DewPlayer, int)
Declaration
public AffordType CanAfford(DewPlayer player, int playerStardust = -1)
Parameters
| Type |
Name |
Description |
| DewPlayer |
player |
|
| int |
playerStardust |
|
Returns
CanAfford(Entity, int)
Declaration
public AffordType CanAfford(Entity entity, int playerStardust = -1)
Parameters
| Type |
Name |
Description |
| Entity |
entity |
|
| int |
playerStardust |
|
Returns
DreamDust(int)
Declaration
public static Cost DreamDust(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Returns
Equals(Cost)
Declaration
public bool Equals(Cost other)
Parameters
| Type |
Name |
Description |
| Cost |
other |
|
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
System.ValueType.Equals(object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
System.ValueType.GetHashCode()
Gold(int)
Declaration
public static Cost Gold(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Returns
HealthPercentage(int)
Declaration
public static Cost HealthPercentage(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Returns
MultiplyGold(float)
Declaration
public Cost MultiplyGold(float scalar)
Parameters
| Type |
Name |
Description |
| float |
scalar |
|
Returns
Platinum(int)
Declaration
public static Cost Platinum(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Returns
Stardust(int)
Declaration
public static Cost Stardust(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
System.ValueType.ToString()
Operators
operator +(Cost, Cost)
Declaration
public static Cost operator +(Cost a, Cost b)
Parameters
Returns
operator +(Cost, FloatCost)
Declaration
public static FloatCost operator +(Cost a, FloatCost b)
Parameters
Returns
operator /(Cost, int)
Declaration
public static Cost operator /(Cost a, int scalar)
Parameters
| Type |
Name |
Description |
| Cost |
a |
|
| int |
scalar |
|
Returns
operator /(Cost, float)
Declaration
public static FloatCost operator /(Cost a, float scalar)
Parameters
| Type |
Name |
Description |
| Cost |
a |
|
| float |
scalar |
|
Returns
operator ==(Cost, Cost)
Declaration
public static bool operator ==(Cost left, Cost right)
Parameters
| Type |
Name |
Description |
| Cost |
left |
|
| Cost |
right |
|
Returns
operator !=(Cost, Cost)
Declaration
public static bool operator !=(Cost left, Cost right)
Parameters
| Type |
Name |
Description |
| Cost |
left |
|
| Cost |
right |
|
Returns
operator *(Cost, int)
Declaration
public static Cost operator *(Cost a, int scalar)
Parameters
| Type |
Name |
Description |
| Cost |
a |
|
| int |
scalar |
|
Returns
operator *(Cost, float)
Declaration
public static FloatCost operator *(Cost a, float scalar)
Parameters
| Type |
Name |
Description |
| Cost |
a |
|
| float |
scalar |
|
Returns
operator *(int, Cost)
Declaration
public static Cost operator *(int scalar, Cost a)
Parameters
| Type |
Name |
Description |
| int |
scalar |
|
| Cost |
a |
|
Returns
operator *(float, Cost)
Declaration
public static FloatCost operator *(float scalar, Cost a)
Parameters
| Type |
Name |
Description |
| float |
scalar |
|
| Cost |
a |
|
Returns
operator -(Cost, Cost)
Declaration
public static Cost operator -(Cost a, Cost b)
Parameters
Returns
operator -(Cost, FloatCost)
Declaration
public static FloatCost operator -(Cost a, FloatCost b)
Parameters
Returns
operator -(Cost)
Declaration
public static Cost operator -(Cost a)
Parameters
| Type |
Name |
Description |
| Cost |
a |
|
Returns