00001 #include "team.h"
00002
00003 Team::Team(void)
00004 : name(QString("")), icon(QPixmap())
00005 {
00006 id=-1;
00007 this->setPick(Team::NO);
00008 }
00009
00010 Team::Team(QString name, QString icon)
00011 : name(name), iconFile(icon), icon(QPixmap(icon)), lost(false)
00012 {
00013 id = Team::count;
00014 count++;
00015 this->setPick(Team::NO);
00016 }
00017
00018 Team::Team(int id, QString name, QString info, QString icon)
00019 : id(id), name(name), iconFile(icon), icon(QPixmap(icon)), info(info), lost(false) {
00020 this->setPick(Team::NO);
00021 }
00022
00023 Team::~Team(void)
00024 {
00025 }
00026
00027
00028 int Team::count = 0;
00029
00030 void Team::setName(QString name)
00031 {
00032 this->name = name;
00033 }
00034
00035 QString Team::getName(void)
00036 {
00037 return name;
00038 }
00039
00040 void Team::setIcon(QString iconFile)
00041 {
00042 icon = QPixmap(iconFile);
00043 }
00044
00045 void Team::setIconFile(QString filename){
00046
00047 this->iconFile = filename;
00048 icon = QPixmap(iconFile);
00049 }
00050
00051 QPixmap Team::getIcon(void)
00052 {
00053 return icon;
00054 }
00055
00056 QString Team::getIconFileName(void)
00057 {
00058 return iconFile;
00059 }
00060
00061 QString Team::getInfo(void)
00062 {
00063 return info;
00064 }
00065
00066 int Team::getId(void)
00067 {
00068 return id;
00069 }
00070
00071 Team::Round Team::getPick(void)
00072 {
00073 return pick;
00074 }
00075
00076 void Team::setPick(Team::Round r)
00077 {
00078 pick=r;
00079 }
00080
00081 bool Team::hasLost(void)
00082 {
00083 return lost;
00084 }
00085
00086 void Team::setState(bool lost)
00087 {
00088 this->lost = lost;
00089 }
00090
00091 Team::Round Team::getPickForInt(int r)
00092 {
00093 switch(r)
00094 {
00095 case 0: return NO;
00096 case 1: return SIXTEEN;
00097 case 2: return EIGHT;
00098 case 3: return QUARTER;
00099 case 4: return HALF;
00100 case 5: return FINAL;
00101 default: return NO;
00102 }
00103 }