Player/Economy/AccountBounty.cs
namespace PlanetMeat;

[Group( "Planet Meat - Player" ), Title( "Account Bounty" ), Icon( "new_label" )]
public sealed class AccountBounty : Component
{
	[Property] private string AccountIdent { get; set; } = "";
	private Bank.Account Account => Bank.Current.GetAccount( AccountIdent );
	private ValueAggregator<float> Aggregator => Account?.AggregateBounty;

	public void ContributeBounty( float amount )
	{
		Aggregator?.SetContribution( this, amount );
	}

	public float GetBountyWithout()
	{
		return Aggregator?.Without( this ) ?? 0.0f;
	}

	protected override void OnDestroy()
	{
		base.OnDestroy();
		Aggregator?.RemoveContribution( this );
	}
}