Player12
An open source football management simulator
Loading...
Searching...
No Matches
DelegationPolicy Class Reference

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 {}
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DelegationPolicy()

DelegationPolicy::DelegationPolicy ( )

Balanced preset.

Member Function Documentation

◆ apply()

void DelegationPolicy::apply ( DelegationPreset  preset)

Replaces every duty with the preset's owners.

◆ delegated()

bool DelegationPolicy::delegated ( Duty  duty) const
inline

◆ matchingPreset()

std::optional< DelegationPreset > DelegationPolicy::matchingPreset ( ) const

The preset this policy matches exactly, if any.

◆ operator==()

bool DelegationPolicy::operator== ( const DelegationPolicy &  ) const
default

◆ owner()

DutyOwner DelegationPolicy::owner ( Duty  duty) const

◆ owners()

const std::array< DutyOwner, DUTY_COUNT > & DelegationPolicy::owners ( ) const
inline

◆ preset()

DelegationPolicy DelegationPolicy::preset ( DelegationPreset  preset)
static

The owners of a preset.

◆ set()

bool DelegationPolicy::set ( Duty  duty,
DutyOwner  owner 
)

Changes one duty; false for an unknown duty.

Member Data Documentation

◆ duties

std::array<DutyOwner, DUTY_COUNT> DelegationPolicy::duties {}
private

The documentation for this class was generated from the following files: