Defines the contract for an entity that possesses a bankroll (money).
This trait tracks the entity's current financial balance and its initial starting balance, providing methods to update the bankroll and calculate its ratio relative to the start.
Type parameters
T
The concrete type of the entity that extends this trait, enabling F-bounded polymorphism for immutable updates.
Updates the entity's bankroll by adding a netValue. The netValue can be positive (gain) or negative (loss). A requirement ensures the bankroll does not drop below zero.
Updates the entity's bankroll by adding a netValue. The netValue can be positive (gain) or negative (loss). A requirement ensures the bankroll does not drop below zero.
Value parameters
netValue
The amount to add to the current bankroll.
Attributes
Returns
A new instance of the entity with the updated bankroll.