Tournament Class Reference

Contains informations and handles a Tournament. More...

#include <tournament.h>

List of all members.

Public Member Functions

 Tournament (void)
 Tournament (const int teamcnt, QString title)
 ~Tournament (void)
int getTeamCount (void)
int getBracketCount (void)
QVector< Team * > getTeams (void) const
QVector< Game * > getGames (void) const
QString getTitle (void) const
GamegetGameByID (int id)
Team::Round getMinRound (void)
void setTeams (QVector< Team * > &teams)
void setTeamCount (int num)
void setTitle (QString title)
bool setPickForTeam (int id, Team::Round round)
void addTeam (Team *team)
void addGame (Game *game)

Static Public Attributes

static const int VALID_TEAMCOUNTS [] = {4,8,16,32}
 Possible team counts.

Private Member Functions

void initTeams (void)
void initGames (void)
void initPicks (void)
bool isValidTeamcount (const int &val)

Private Attributes

QVector< Team * > teams
QVector< Game * > games
QString title
int teamcnt
int bracketcnt
Team::Round minRound

Detailed Description

Contains informations and handles a Tournament.

Contains everything about the tournament (name, teams, games, etc.).

Definition at line 19 of file tournament.h.


Constructor & Destructor Documentation

Tournament::Tournament ( void   ) 

Definition at line 5 of file tournament.cpp.

Tournament::Tournament ( const int  teamcnt,
QString  title 
)

Creates a new Tournament with "teamcnt"-teams and title. Initializes teams and games with standard values.

Definition at line 7 of file tournament.cpp.

Tournament::~Tournament ( void   ) 

Definition at line 22 of file tournament.cpp.


Member Function Documentation

void Tournament::addGame ( Game game  ) 

Definition at line 75 of file tournament.cpp.

void Tournament::addTeam ( Team team  ) 

Definition at line 80 of file tournament.cpp.

int Tournament::getBracketCount ( void   ) 

Returns the number of brackets on one side (= number of teams/4)

Definition at line 50 of file tournament.cpp.

Game * Tournament::getGameByID ( int  id  ) 

Definition at line 126 of file tournament.cpp.

QVector< Game * > Tournament::getGames ( void   )  const

Definition at line 70 of file tournament.cpp.

Team::Round Tournament::getMinRound ( void   ) 

Definition at line 114 of file tournament.cpp.

int Tournament::getTeamCount ( void   ) 

Definition at line 45 of file tournament.cpp.

QVector< Team * > Tournament::getTeams ( void   )  const

Definition at line 65 of file tournament.cpp.

QString Tournament::getTitle ( void   )  const

Definition at line 55 of file tournament.cpp.

void Tournament::initGames ( void   )  [private]

Definition at line 100 of file tournament.cpp.

void Tournament::initPicks ( void   )  [private]

Definition at line 119 of file tournament.cpp.

void Tournament::initTeams ( void   )  [private]

Definition at line 90 of file tournament.cpp.

bool Tournament::isValidTeamcount ( const int &  val  )  [private]

Definition at line 152 of file tournament.cpp.

bool Tournament::setPickForTeam ( int  id,
Team::Round  round 
)

Definition at line 136 of file tournament.cpp.

void Tournament::setTeamCount ( int  num  ) 

Definition at line 35 of file tournament.cpp.

void Tournament::setTeams ( QVector< Team * > &  teams  ) 

Definition at line 60 of file tournament.cpp.

void Tournament::setTitle ( QString  title  ) 

Definition at line 85 of file tournament.cpp.


Member Data Documentation

int Tournament::bracketcnt [private]

Definition at line 60 of file tournament.h.

QVector<Game*> Tournament::games [private]

Definition at line 57 of file tournament.h.

Definition at line 61 of file tournament.h.

int Tournament::teamcnt [private]

Definition at line 59 of file tournament.h.

QVector<Team*> Tournament::teams [private]

Definition at line 56 of file tournament.h.

QString Tournament::title [private]

Definition at line 58 of file tournament.h.

const int Tournament::VALID_TEAMCOUNTS = {4,8,16,32} [static]

Possible team counts.

Definition at line 32 of file tournament.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 29 01:48:12 2010 for AdaptiviTree by  doxygen 1.6.3