#include "performance.h"
+/**
+ * \brief Init UI.
+ */
void PerformanceTab::init() {
QSettings settings("config/formation.ini", QSettings::IniFormat);
mainLayout->update();
}
+/**
+ * \brief Performance Tab constructor.
+ */
PerformanceTab::PerformanceTab(QWidget *parent): QWidget(parent), defs(0), mids(0), fors(0) {
mainLayout = new QVBoxLayout;
setLayout(mainLayout);
init();
}
+/**
+ * \brief Performance Tab destructor.
+ */
PerformanceTab::~PerformanceTab() {
for(int i=0; i<11; ++i) {
delete player[i];
delete mainLayout;
}
+/**
+ * \brief Slot assigned to data change action.
+ */
void PerformanceTab::dataChanged() {
container->removeWidget(format);
delete format;
init();
}
+/**
+ * \brief Set adequate player post by selected formation.
+ */
void PerformanceTab::postLabels() {
int LMpos = 0;
if(!defsC) {
}
}
+/**
+ * \brief Count performance of each line (def, mid, fwd).
+ *
+ * Count with offensive/defensive order of each player.
+ */
void PerformanceTab::countPerf() {
defs = 0;
mids = 0;
}
}
+/**
+ * \brief Slot assigned to "count performance" button.
+ *
+ * Print all play-variants points..
+ */
void PerformanceTab::recount() {
double homeMod = home->itemData(home->currentIndex()).toDouble();
double pre = (1.0+((double)aggress/1000))/(7.0 - (club.spirit.toDouble()/1000) + homeMod);
result->setText(text);
}
+/**
+ * \brief Slot assigned to aggression change.
+ *
+ * \param[in] a Aggression ID.
+ * Save aggression to config file.
+ */
void PerformanceTab::aggressChange(int a) {
aggress = a*5;
QSettings settings("config/formation.ini", QSettings::IniFormat);
settings.sync();
}
+/**
+ * \brief Slot assigned to formation change.
+ * \param[in] t Formation ID.
+ */
void PerformanceTab::formatChange(int t) {
QSettings settings("config/formation.ini", QSettings::IniFormat);
if(t<8 && t>=0) { settings.setValue("form", t); settings.sync(); }
reorderPlayers();
}
+/**
+ * \brief Slot assigned to player combobox changes.
+ * \param[in] id possition ID
+ */
void PerformanceTab::playerChange(int id) {
id = 1; //avoid warning :-D
QSettings settings("config/formation.ini", QSettings::IniFormat);
settings.sync();
}
+/**
+ * \brief Slot assigned to "re-order players" button.
+ *
+ * If there are players assigned to wrong possition (by selected formation),
+ * then this function give here players with correct post.
+ * This do not look at player performance, first is selected..
+ */
void PerformanceTab::reorderPlayers() {
int i;
int from = 0;
}
}
+/**
+ * \brief Searching for first player with this post.
+ * \param[in] post player possition.
+ */
int PerformanceTab::findFirstOnPost(const QString &post) {
for(int i=0; i<playerCnt; ++i) {
if(post == pls[i].position) return i;