00001 #ifndef TOURNAMENT_H 00002 #define TOURNAMENT_H 00003 00004 #include "game.h" 00005 #include <QVector> 00006 #include <QVectorIterator> 00007 #include <QString> 00008 #include <algorithm> 00009 00010 00019 class Tournament 00020 { 00021 public: 00022 Tournament(void); 00023 00028 Tournament(const int teamcnt, QString title); 00029 ~Tournament(void); 00030 00032 static const int VALID_TEAMCOUNTS[]; 00033 00034 //getters 00035 int getTeamCount(void); 00039 int getBracketCount(void); 00040 QVector<Team*> getTeams(void) const; 00041 QVector<Game*> getGames (void) const; 00042 QString getTitle(void) const; 00043 Game* getGameByID(int id); 00044 Team::Round getMinRound(void); 00045 00046 //setters 00047 void setTeams(QVector<Team*> &teams); 00048 void setTeamCount(int num); 00049 void setTitle(QString title); 00050 bool setPickForTeam(int id, Team::Round round); 00051 00052 void addTeam(Team* team); 00053 void addGame(Game* game); 00054 00055 private: 00056 QVector<Team*> teams; 00057 QVector<Game*> games; 00058 QString title; 00059 int teamcnt; 00060 int bracketcnt; 00061 Team::Round minRound; 00062 00063 void initTeams(void); 00064 void initGames(void); 00065 void initPicks(void); 00066 bool isValidTeamcount(const int &val); 00067 }; 00068 00069 #endif