Kata Tournament Runner  0.1.00
 All Classes Namespaces Functions Variables Enumerations Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
TournamentRunner::Tournament Class Reference

The Tournament class is the starting point for the tournament management. More...

#include <tournament.h>

Public Types

using RankAnnotatedParticipant = std::pair< size_t, Karateka >
 

Public Member Functions

 Tournament ()=default
 Default empty Tournament constructor.
 
 Tournament (TournamentData data)
 Tournament constructor. More...
 
std::string name () const
 Tournament name. More...
 
std::string date_as_string () const
 Return the date the tournament is held as ISO 8601 extended format string (CCYY-MM-DD) More...
 
Date date () const
 Return the date the tournament is held as Date. More...
 
std::string location () const
 Tournament location address. More...
 
void update_data (const TournamentData &data)
 Update the tournament data. More...
 
void add_participant (const Karateka &participant)
 Register a participant to the tournament. More...
 
size_t number_of_participants () const
 Return the number of registred participants. More...
 
Karateka & get_participant (size_t start_number)
 Return the participant with the given startnumber. More...
 
void remove_participant (size_t start_number)
 remove_participant More...
 
std::vector< Karateka > get_ranked_list_of_participants () const
 Return a ranked list of participants. The highest ranked comes first. More...
 
std::vector
< RankAnnotatedParticipant > 
get_anotated_ranked_list_of_participants () const
 Return a ranked list of participants anotated with the actual rank. More...
 
uint8_t get_current_round () const
 Return the current active round. More...
 
uint8_t start_next_kata_round ()
 Start the next kata round. More...
 
std::vector< size_t > get_startlist_for_next_kata_round (size_t no_of_participants_for_round) const
 Return the startlist for the next kata round. More...
 

Static Public Attributes

static constexpr auto rank_annotated_participant_rank_idx = 0u
 
static constexpr auto rank_annotated_participant_karateka_idx = 1u
 

Friends

class boost::serialization::access
 

Detailed Description

The Tournament class is the starting point for the tournament management.

Remarks
Serializable

Constructor & Destructor Documentation

TournamentRunner::Tournament::Tournament ( TournamentData  data)
explicit

Tournament constructor.

Parameters
dataTournament data as struct

Member Function Documentation

void TournamentRunner::Tournament::add_participant ( const Karateka &  participant)

Register a participant to the tournament.

Parameters
participant

Here is the call graph for this function:

Here is the caller graph for this function:

Date TournamentRunner::Tournament::date ( ) const
inline

Return the date the tournament is held as Date.

Returns
Tournament date
std::string TournamentRunner::Tournament::date_as_string ( ) const

Return the date the tournament is held as ISO 8601 extended format string (CCYY-MM-DD)

Returns
Tournament date as ISO 8601 extended format string (CCYY-MM-DD)

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< Tournament::RankAnnotatedParticipant > TournamentRunner::Tournament::get_anotated_ranked_list_of_participants ( ) const

Return a ranked list of participants anotated with the actual rank.

Returns
list of the (rank, participants) tuples ranked by the scores.

Here is the call graph for this function:

uint8_t TournamentRunner::Tournament::get_current_round ( ) const
inline

Return the current active round.

Returns
current round

Here is the caller graph for this function:

Karateka & TournamentRunner::Tournament::get_participant ( size_t  start_number)
inline

Return the participant with the given startnumber.

Parameters
start_numberStart number given to the karateka
Returns
Karateka with the given Start number

Here is the caller graph for this function:

std::vector< Karateka > TournamentRunner::Tournament::get_ranked_list_of_participants ( ) const

Return a ranked list of participants. The highest ranked comes first.

Returns
list of the participants ranked by the scores

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< size_t > TournamentRunner::Tournament::get_startlist_for_next_kata_round ( size_t  no_of_participants_for_round) const

Return the startlist for the next kata round.

Parameters
no_of_participants_for_roundNumber of participants which can be nominated for the next round
Returns
The startlist for the next kata round.
Note
The ordering is backwards, i.e. the best scored participant starts last
std::string TournamentRunner::Tournament::location ( ) const
inline

Tournament location address.

Returns
Tournament location address

Here is the caller graph for this function:

std::string TournamentRunner::Tournament::name ( ) const
inline

Tournament name.

Returns
Tournament name

Here is the caller graph for this function:

size_t TournamentRunner::Tournament::number_of_participants ( ) const
inline

Return the number of registred participants.

Returns
The number of registred participants

Here is the caller graph for this function:

void TournamentRunner::Tournament::remove_participant ( size_t  start_number)

remove_participant

Parameters
start_number

Here is the call graph for this function:

uint8_t TournamentRunner::Tournament::start_next_kata_round ( )

Start the next kata round.

Returns
Return the round number of the started round

Here is the call graph for this function:

void TournamentRunner::Tournament::update_data ( const TournamentData &  data)
inline

Update the tournament data.

Parameters
dataNew Tournament data

Here is the caller graph for this function:


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