Version 0.3
[aspt.git] / performance.h
1 /*******************************************************************
2 Jan Cermak | johniez | aspt.johniez.com
3 Creative Commons 2.5 Attribution-NonCommercial-NoDerivs 2.5 license
4 http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode
5 *******************************************************************/
6
7 #ifndef PERFORMANCETAB__H__
8 #define PERFORMANCETAB__H__
9
10 #include <QWidget>
11 #include <QComboBox>
12 #include <QVBoxLayout>
13 #include <QHBoxLayout>
14 #include <QPushButton>
15 #include <QLabel>
16 #include <QSettings>
17
18 #include "playerdetail.h"
19 #include "clubtab.h"
20
21 extern void parse(const QString &);
22 extern int playerCnt;
23 extern Player pls[];
24
25 extern ClubStruct club;
26
27 /// Performance widget.
28 class PerformanceTab: public QWidget {
29         Q_OBJECT
30         QVBoxLayout *mainLayout;
31         QComboBox *player[11];
32         QLabel *postLabel[11];
33         QLabel *plPerfLabel[11];
34         QComboBox *orders[11];
35         QComboBox *format;
36         QComboBox *aggression;
37         QComboBox *home;
38         QHBoxLayout *plCont[11];
39         QLabel *result;
40         QPushButton *cButt;
41         QHBoxLayout *container;
42         QPushButton *reorderPl;
43         
44         double defs;    //defender points count
45         int defsC;      //count of defenders
46         double mids;    //midfield points count
47         int midsC;
48         double fors;            //forward points count
49         int forsC;
50         int aggress;    //aggression
51         
52         void countPerf();
53         void postLabels();      //redraw position labels
54         void init();
55         int findFirstOnPost(const QString &);           // find first player of
56 public:
57         PerformanceTab(QWidget *parent = 0);
58         ~PerformanceTab();
59 protected slots:
60         void formatChange(int);
61         void recount();
62         void aggressChange(int);
63         void playerChange(int);
64         void dataChanged();
65         void reorderPlayers();
66 };
67
68 #endif