| 1 | /* handicap.cpp */ |
| 2 | /* |
| 3 | * This file is part of PRAELECTOR. |
| 4 | * |
| 5 | * PRAELECTOR is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * COLLATINVS is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with PRAELECTOR; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | * |
| 19 | * © Yves Ouvrard, 2009 - 2018 |
| 20 | */ |
| 21 | |
| 22 | #include <handicap.h> |
| 23 | #include <iostream> |
| 24 | #include <QDebug> |
| 25 | |
| 26 | /********************** |
| 27 | Classe Handicap |
| 28 | **********************/ |
| 29 | |
| 30 | Handicap::Handicap(QStringList sl) |
| 31 | { |
| 32 | // contôle |
| 33 | if (sl.count() < 3) |
| 34 | { |
| 35 | std::cerr << qPrintable("ligne mal formée"+sl.join(":")); |
| 36 | } |
| 37 | _forme = sl.at(0); |
| 38 | QString lem = sl.at(1); |
| 39 | if (lem.startsWith('-')) |
| 40 | _lemme = lem.mid(1); |
| 41 | else _lemmeExclu = lem; |
| 42 | _hand = sl.at(2).toInt(); |
| 43 | } |
| 44 | |
| 45 | QString Handicap::forme() |
| 46 | { |
| 47 | return _forme; |
| 48 | } |
| 49 | |
| 50 | QString Handicap::lemme() |
| 51 | { |
| 52 | return _lemme; |
| 53 | } |
| 54 | |
| 55 | QString Handicap::lemmeExclu() |
| 56 | { |
| 57 | return _lemmeExclu; |
| 58 | } |
| 59 | |
| 60 | int Handicap::hand() |
| 61 | { |
| 62 | return _hand; |
| 63 | } |