QTfrontend/team.h
branchflibqtfrontend
changeset 8103 c247346d296f
parent 8100 0e6fadf81a2c
child 8106 861d145b270e
equal deleted inserted replaced
8100:0e6fadf81a2c 8103:c247346d296f
    32 
    32 
    33 class HWTeamConstructException
    33 class HWTeamConstructException
    34 {
    34 {
    35 };
    35 };
    36 
    36 
    37 // structure for customization and statistics of a single hedgehog
       
    38 struct HWHog
       
    39 {
       
    40     QString Name;
       
    41     QString Hat;
       
    42     int Rounds, Kills, Deaths, Suicides;
       
    43 };
       
    44 
       
    45 // class representing a team
    37 // class representing a team
    46 class HWTeam : public QObject
    38 class HWTeam : public QObject
    47 {
    39 {
    48         Q_OBJECT
    40         Q_OBJECT
    49 
    41 
    50     public:
    42     public:
    51 
    43 
    52         // constructors
    44         // constructors
    53         HWTeam(const QString & teamname);
    45         HWTeam(const QString & teamname = QString(), QObject * parent = 0);
    54         HWTeam(const QStringList& strLst);
    46         HWTeam(const QStringList& strLst, QObject * parent = 0);
    55         HWTeam();
       
    56         HWTeam(const HWTeam & other);
    47         HWTeam(const HWTeam & other);
    57         ~HWTeam();
    48         ~HWTeam();
    58 
    49 
    59         // file operations
    50         // file operations
    60         static HWTeam loadFromFile(const QString & teamName);
    51         static HWTeam loadFromFile(const QString & teamName);
    69         QColor qcolor() const;
    60         QColor qcolor() const;
    70         unsigned int difficulty() const;
    61         unsigned int difficulty() const;
    71         QString flag() const;
    62         QString flag() const;
    72         QString fort() const;
    63         QString fort() const;
    73         QString grave() const;
    64         QString grave() const;
    74         const HWHog & hedgehog(unsigned int idx) const;
    65         //const HWHog & hedgehog(unsigned int idx) const;
    75         bool isNetTeam() const;
    66         bool isNetTeam() const;
    76         QString keyBind(unsigned int idx) const;
    67         QString keyBind(unsigned int idx) const;
    77         QString name() const;
    68         QString name() const;
    78         unsigned char numHedgehogs() const;
    69         unsigned char numHedgehogs() const;
    79         QString owner() const;
    70         QString owner() const;
    83         void bindKey(unsigned int idx, const QString & key);
    74         void bindKey(unsigned int idx, const QString & key);
    84         void setDifficulty(unsigned int level);
    75         void setDifficulty(unsigned int level);
    85         void setFlag(const QString & flag);
    76         void setFlag(const QString & flag);
    86         void setFort(const QString & fort);
    77         void setFort(const QString & fort);
    87         void setGrave(const QString & grave);
    78         void setGrave(const QString & grave);
    88         void setHedgehog(unsigned int idx, HWHog hh);
       
    89         void setName(const QString & name);
    79         void setName(const QString & name);
    90         void setNumHedgehogs(unsigned char num);
    80         void setNumHedgehogs(unsigned char num);
    91         void setVoicepack(const QString & voicepack);
    81         void setVoicepack(const QString & voicepack);
    92 
    82 
       
    83         QString hedgehogName(int index) const;
       
    84         QString hedgehogHat(int index) const;
       
    85         void setHedgehogName(int index, const QString & name);
       
    86         void setHedgehogHat(int index, const QString & hat);
       
    87 
    93         // increments for statistical info
    88         // increments for statistical info
    94         void incRounds();
    89         void incRounds();
    95         void incWins();
    90         void incWins();
    96 
       
    97         // convert team info into strings for further computation
       
    98         QStringList teamGameConfig(quint32 InitHealth) const;
       
    99 
    91 
   100         // comparison operators
    92         // comparison operators
   101         bool operator == (const HWTeam& t1) const;
    93         bool operator == (const HWTeam& t1) const;
   102         bool operator < (const HWTeam& t1) const;
    94         bool operator < (const HWTeam& t1) const;
   103         HWTeam & operator = (const HWTeam & other);
    95         HWTeam & operator = (const HWTeam & other);
   104 
    96 
   105 public slots:
    97 public slots:
   106         void setColor(int color);
    98         void setColor(int color);
   107 
    99 
   108     private:
   100     private:
   109 
   101         QString m_oldTeamName;
   110         QString OldTeamName;
       
   111 
   102 
   112         // class members that contain the general team info and settings
   103         // class members that contain the general team info and settings
   113         QString m_name;
       
   114         QString m_grave;
       
   115         QString m_fort;
       
   116         QString m_flag;
       
   117         QString m_voicepack;
       
   118         QList<HWHog> m_hedgehogs;
       
   119         quint8 m_difficulty;
       
   120         QList<BindAction> m_binds;
       
   121 
       
   122         flib_team * m_team;
   104         flib_team * m_team;
   123 
       
   124         // class members that contain info for the current game setup
       
   125         quint8 m_numHedgehogs;
       
   126         int m_color;
       
   127         bool m_isNetTeam;
       
   128         QString m_owner;
       
   129 
       
   130         // class members that contain statistics, etc.
       
   131         unsigned int m_campaignProgress;
       
   132         unsigned int m_rounds;
       
   133         unsigned int m_wins;
       
   134         unsigned int AchievementProgress[MAX_ACHIEVEMENTS];
       
   135 };
   105 };
   136 
   106 
   137 #endif
   107 #endif