Generalized Store System (#10201)
This commit is contained in:
22
Content.Server/Store/Components/CurrencyComponent.cs
Normal file
22
Content.Server/Store/Components/CurrencyComponent.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Store;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
|
||||
|
||||
namespace Content.Server.Store.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Identifies a component that can be inserted into a store
|
||||
/// to increase its balance.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class CurrencyComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The value of the currency.
|
||||
/// The string is the currency type that will be added.
|
||||
/// The FixedPoint2 is the value of each individual currency entity.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("price", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<FixedPoint2, CurrencyPrototype>))]
|
||||
public Dictionary<string, FixedPoint2> Price = new();
|
||||
}
|
||||
Reference in New Issue
Block a user