Files
tbd-station-14/Content.Shared/Cargo/Components/BankClientComponent.cs
Milon 8e10ff1f08 fix UpdateBankAccount (#35749)
* trolled

* fun

* fuck me
2025-03-09 21:50:24 +01:00

26 lines
900 B
C#

using Robust.Shared.GameStates;
namespace Content.Shared.Cargo.Components;
/// <summary>
/// Makes an entity a client of the station's bank account.
/// When its balance changes it will have <see cref="BankBalanceUpdatedEvent"/> raised on it.
/// Other systems can then use this for logic or to update ui states.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedCargoSystem))]
[AutoGenerateComponentState]
public sealed partial class BankClientComponent : Component
{
/// <summary>
/// The balance updated for the last station this entity was a part of.
/// </summary>
[DataField, AutoNetworkedField]
public int Balance;
}
/// <summary>
/// Raised on an entity with <see cref="BankClientComponent"/> when the bank's balance is updated.
/// </summary>
[ByRefEvent]
public readonly record struct BankBalanceUpdatedEvent(EntityUid Station, int Balance);