Class PricingSystem
This handles calculating the price of items, and implements two basic methods of pricing materials.
Inheritance
System.Object
PricingSystem
Namespace: Content.Server.Cargo.Systems
Assembly: Content.Server.dll
Syntax
public sealed class PricingSystem : EntitySystem
Methods
| Improve this Doc View SourceAppraiseGrid(EntityUid, Nullable<Func<EntityUid, Boolean>>, Nullable<Action<EntityUid, Double>>)
Appraises a grid, this is mainly meant to be used by yarrs.
Declaration
public double AppraiseGrid(EntityUid grid, Func<EntityUid, bool>? predicate = null, Action<EntityUid, double>? afterPredicate = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | grid | The grid to appraise. |
System.Nullable<Func<EntityUid, System.Boolean>> | predicate | An optional predicate that controls whether or not the entity is counted toward the total. |
System.Nullable<Action<EntityUid, System.Double>> | afterPredicate | An optional predicate to run after the price has been calculated. Useful for high scores or similar. |
Returns
Type | Description |
---|---|
System.Double | The total value of the grid. |
GetEstimatedPrice(EntityPrototype)
Get a rough price for an entityprototype. Does not consider contained entities.
Declaration
public double GetEstimatedPrice(EntityPrototype prototype)
Parameters
Type | Name | Description |
---|---|---|
Robust.Shared.Prototypes.EntityPrototype | prototype |
Returns
Type | Description |
---|---|
System.Double |
GetPrice(EntityUid)
Appraises an entity, returning it's price.
Declaration
public double GetPrice(EntityUid uid)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The entity to appraise. |
Returns
Type | Description |
---|---|
System.Double | The price of the entity. |
Remarks
This fires off an event to calculate the price. Calculating the price of an entity that somehow contains itself will likely hang.
Initialize()
Declaration
public override void Initialize()