Game Class Reference

Contains the data of one game. More...

#include <game.h>

List of all members.

Classes

struct  Bracket
struct  Result

Public Member Functions

 Game (void)
 Game (int ID, Team *team1, Team *team2, int result[2])
 Game (int ID, Team *team1, Team *team2, int result[2], Game *leftChild, Game *rightChild)
 Game (int ID, Team *team1, Team *team2, int result[2], QString date, QString descr)
 ~Game (void)
struct Bracket getBracket (void) const
int getID (void) const
int getState (void) const
QString getDate (void)
QString getDescr (void)
TeamgetTeam (int teamnum) const
struct Result getResult (void) const
GamegetChild (int dir) const
bool isChildGamesDecided (void)
int getTeam1 (void)
int getTeam2 (void)
TeamgetTeam1Direct (void)
TeamgetTeam2Direct (void)
void setBracket (int y0, int dy, int ylink, int level, int dir, int dashOffset, QPen pen)
void setBracket (int y0, int dy, int ylink, int dashOffset)
void setTeam (int teamnum, Team *team)
void setTeams (Team *team1, Team *team2)
void setResult (int score[2])
void setChilds (Game *leftChild, Game *rightChild)
void setPen (QPen pen)
void setPenColor (int val)

Static Public Attributes

static const int UNDECIDED = 0
 Game is undecided.
static const int WINTEAM1 = 1
 Team 1 wins.
static const int WINTEAM2 = 2
 Team 2 wins.
static const int LEFTCHILD = 0
 Left child game.
static const int RIGHTCHILD = 1
 Right child game.
static const int UNDEFINED = 0
 Game has no child games.

Private Attributes

int ID
Teamteam1
Teamteam2
struct Result result
struct Bracket bracket
GameleftChild
GamerightChild
QString date
QString descr

Detailed Description

Contains the data of one game.

This class contains all informations that is needed for a game, as the two opponents, the result, the date, etc. It also contains some informations about the position in the canvas (which game is the left/right one, which coordinates does the game have) and informations who has won, etc.

Definition at line 18 of file game.h.


Constructor & Destructor Documentation

Game::Game ( void   ) 

Creates an empty Game.

Definition at line 3 of file game.cpp.

Game::Game ( int  ID,
Team team1,
Team team2,
int  result[2] 
)

Creates a Game with Teams and Result.

Definition at line 7 of file game.cpp.

Game::Game ( int  ID,
Team team1,
Team team2,
int  result[2],
Game leftChild,
Game rightChild 
)

Creates a Game with Teams, Result and children.

Definition at line 13 of file game.cpp.

Game::Game ( int  ID,
Team team1,
Team team2,
int  result[2],
QString  date,
QString  descr 
)

Creates a Game with Teams, Result, date and description.

Definition at line 19 of file game.cpp.

Game::~Game ( void   ) 

Definition at line 26 of file game.cpp.


Member Function Documentation

struct Game::Bracket Game::getBracket ( void   )  const [read]

Definition at line 54 of file game.cpp.

Game * Game::getChild ( int  dir  )  const

Returns a child of this Game. dir = 0: leftchild dir = 1: rightchild

Definition at line 119 of file game.cpp.

QString Game::getDate ( void   ) 

Definition at line 82 of file game.cpp.

QString Game::getDescr ( void   ) 

Definition at line 87 of file game.cpp.

int Game::getID ( void   )  const

Definition at line 30 of file game.cpp.

struct Game::Result Game::getResult ( void   )  const [read]

Definition at line 92 of file game.cpp.

int Game::getState ( void   )  const

Definition at line 103 of file game.cpp.

Team * Game::getTeam ( int  teamnum  )  const

Returns the Team with teamnum 1 or 2.

Definition at line 73 of file game.cpp.

int Game::getTeam1 ( void   ) 

Returns the ID of Team 1.

Definition at line 140 of file game.cpp.

Team * Game::getTeam1Direct ( void   ) 

Returns Team 1.

Definition at line 150 of file game.cpp.

int Game::getTeam2 ( void   ) 

Returns the ID of Team 2.

Definition at line 145 of file game.cpp.

Team * Game::getTeam2Direct ( void   ) 

Returns Team 2.

Definition at line 155 of file game.cpp.

bool Game::isChildGamesDecided ( void   ) 

Returns if the Games of the children are decided yet.

Definition at line 127 of file game.cpp.

void Game::setBracket ( int  y0,
int  dy,
int  ylink,
int  dashOffset 
)

Sets the data for the Bracket.

Definition at line 46 of file game.cpp.

void Game::setBracket ( int  y0,
int  dy,
int  ylink,
int  level,
int  dir,
int  dashOffset,
QPen  pen 
)

Sets the data for the Bracket.

Definition at line 35 of file game.cpp.

void Game::setChilds ( Game leftChild,
Game rightChild 
)

Definition at line 113 of file game.cpp.

void Game::setPen ( QPen  pen  ) 

Definition at line 160 of file game.cpp.

void Game::setPenColor ( int  val  ) 

Definition at line 165 of file game.cpp.

void Game::setResult ( int  score[2]  ) 

Definition at line 97 of file game.cpp.

void Game::setTeam ( int  teamnum,
Team team 
)

Sets the Team with teamnum 1 or 2 (first Team or second Team)

Definition at line 65 of file game.cpp.

void Game::setTeams ( Team team1,
Team team2 
)

Definition at line 59 of file game.cpp.


Member Data Documentation

struct Bracket Game::bracket [private]

Definition at line 150 of file game.h.

QString Game::date [private]

Definition at line 153 of file game.h.

QString Game::descr [private]

Definition at line 154 of file game.h.

int Game::ID [private]

Definition at line 146 of file game.h.

Game* Game::leftChild [private]

Definition at line 151 of file game.h.

const int Game::LEFTCHILD = 0 [static]

Left child game.

Definition at line 50 of file game.h.

struct Result Game::result [private]

Definition at line 149 of file game.h.

Game* Game::rightChild [private]

Definition at line 152 of file game.h.

const int Game::RIGHTCHILD = 1 [static]

Right child game.

Definition at line 52 of file game.h.

Team* Game::team1 [private]

Definition at line 147 of file game.h.

Team* Game::team2 [private]

Definition at line 148 of file game.h.

const int Game::UNDECIDED = 0 [static]

Game is undecided.

Definition at line 44 of file game.h.

const int Game::UNDEFINED = 0 [static]

Game has no child games.

Definition at line 54 of file game.h.

const int Game::WINTEAM1 = 1 [static]

Team 1 wins.

Definition at line 46 of file game.h.

const int Game::WINTEAM2 = 2 [static]

Team 2 wins.

Definition at line 48 of file game.h.


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