Player/Economy/MeatImprover.cs
namespace PlanetMeat;
[Group( "Planet Meat - Player" ), Title( "Meat Improver" ), Icon( "link" )]
public sealed class MeatImprover : Component
{
public static ValueAggregator<float> AggregateProtection => Agenda.Current.AggregateMeatProtection;
public static ValueAggregator<float> AggregateRate => Agenda.Current.AggregateMeatRate;
public static ValueAggregator<int> AggregateIncome => Agenda.Current.AggregateMeatIncome;
public void Contribute( ValueAggregator<float> agg, float amount ) => agg.SetContribution( this, amount );
public void Contribute( ValueAggregator<int> agg, int amount ) => agg.SetContribution( this, amount );
public float GetWithout( ValueAggregator<float> agg ) => agg.Without( this );
public int GetWithout( ValueAggregator<int> agg ) => agg.Without( this );
protected override void OnDestroy()
{
base.OnDestroy();
AggregateProtection.RemoveContribution( this );
AggregateRate.RemoveContribution( this );
AggregateIncome.RemoveContribution( this );
}
}