Show / Hide Table of Contents

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 Source

AppraiseGrid(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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾