|
Player12
An open source football management simulator
|
Who handles each duty of the managed club. More...
#include <delegation.h>
Public Member Functions | |
| DelegationPolicy () | |
| DutyOwner | owner (Duty duty) const |
| bool | delegated (Duty duty) const |
| bool | set (Duty duty, DutyOwner owner) |
| void | apply (DelegationPreset preset) |
| std::optional< DelegationPreset > | matchingPreset () const |
| const std::array< DutyOwner, DUTY_COUNT > & | owners () const |
| bool | operator== (const DelegationPolicy &) const =default |
Static Public Member Functions | |
| static DelegationPolicy | preset (DelegationPreset preset) |
Private Attributes | |
| std::array< DutyOwner, DUTY_COUNT > | duties {} |
Who handles each duty of the managed club.
Other systems read the policy through GameController::isDelegated(); the policy itself holds no game logic. When the manager changes something by hand that the assistant owns, GameController takes the duty back for him.
| DelegationPolicy::DelegationPolicy | ( | ) |
Balanced preset.
| void DelegationPolicy::apply | ( | DelegationPreset | preset | ) |
Replaces every duty with the preset's owners.
|
inline |
| std::optional< DelegationPreset > DelegationPolicy::matchingPreset | ( | ) | const |
The preset this policy matches exactly, if any.
|
default |
|
inline |
|
static |
The owners of a preset.
Changes one duty; false for an unknown duty.
|
private |