doxygen comments
[aspt.git] / performance.cc
index 9da30aa..a5d3d7e 100644 (file)
@@ -6,6 +6,9 @@ http://creativecommons.org/licenses/by-nc-nd/2.5/legalcode
 
 #include "performance.h"
 
+/**
+ * \brief Init UI.
+ */
 void PerformanceTab::init() {
        QSettings settings("config/formation.ini", QSettings::IniFormat);
        
@@ -89,12 +92,18 @@ void PerformanceTab::init() {
        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];
@@ -113,6 +122,9 @@ PerformanceTab::~PerformanceTab() {
        delete mainLayout;
 }
 
+/**
+ * \brief Slot assigned to data change action.
+ */
 void PerformanceTab::dataChanged() {
        container->removeWidget(format);
        delete format;
@@ -141,6 +153,9 @@ void PerformanceTab::dataChanged() {
        init();
 }
 
+/**
+ * \brief Set adequate player post by selected formation.
+ */
 void PerformanceTab::postLabels() {
        int LMpos = 0;
        if(!defsC) {
@@ -241,6 +256,11 @@ void PerformanceTab::postLabels() {
        }
 }
 
+/**
+ * \brief Count performance of each line (def, mid, fwd).
+ *
+ * Count with offensive/defensive order of each player.
+ */
 void PerformanceTab::countPerf() {
        defs = 0;
        mids = 0;
@@ -278,6 +298,11 @@ void PerformanceTab::countPerf() {
        }
 }
 
+/**
+ * \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);
@@ -294,6 +319,12 @@ void PerformanceTab::recount() {
        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);
@@ -301,6 +332,10 @@ void PerformanceTab::aggressChange(int a) {
        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(); }
@@ -334,6 +369,10 @@ void PerformanceTab::formatChange(int t) {
        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);
@@ -344,6 +383,13 @@ void PerformanceTab::playerChange(int id) {
        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;
@@ -404,6 +450,10 @@ void PerformanceTab::reorderPlayers() {
        }
 }
 
+/**
+ * \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;