2008-01-20 19:40:12 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* Eliot
|
2012-10-07 16:25:41 +02:00
|
|
|
* Copyright (C) 2008-2012 Olivier Teulière
|
2008-01-20 19:40:12 +01:00
|
|
|
* Authors: Olivier Teulière <ipkiss @@ gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef NEW_GAME_H_
|
|
|
|
#define NEW_GAME_H_
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2012-02-18 22:26:52 +01:00
|
|
|
#include "ui/new_game.ui.h"
|
2012-02-10 20:14:15 +01:00
|
|
|
#include "logging.h"
|
|
|
|
|
2008-01-20 19:40:12 +01:00
|
|
|
|
2012-02-16 21:59:01 +01:00
|
|
|
class PlayersTableHelper;
|
2008-01-20 19:40:12 +01:00
|
|
|
class Dictionary;
|
2008-11-30 21:53:44 +01:00
|
|
|
class PublicGame;
|
2008-01-20 19:40:12 +01:00
|
|
|
|
|
|
|
class NewGame: public QDialog, private Ui::NewGameDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT;
|
2012-02-10 20:14:15 +01:00
|
|
|
DEFINE_LOGGER();
|
2008-01-20 19:40:12 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit NewGame(QWidget *iParent = 0);
|
|
|
|
|
|
|
|
/// Possible values for the player type
|
2008-08-31 13:48:11 +02:00
|
|
|
static const char * kHUMAN;
|
|
|
|
static const char * kAI;
|
2008-01-20 19:40:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create and return a game object from the information of the dialog.
|
|
|
|
* The Game object is always valid
|
|
|
|
*/
|
2008-11-30 21:53:44 +01:00
|
|
|
PublicGame * createGame(const Dictionary& iDic) const;
|
2008-01-20 19:40:12 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void enableOkButton();
|
2011-08-27 20:00:37 +02:00
|
|
|
void enablePlayers(bool);
|
2012-02-17 23:10:55 +01:00
|
|
|
void addSelectedToFav();
|
2012-02-17 22:18:20 +01:00
|
|
|
void addFavoritePlayers();
|
2012-10-06 12:16:36 +02:00
|
|
|
void onJokerChecked(int);
|
|
|
|
void onExplosiveChecked(int);
|
2008-01-20 19:40:12 +01:00
|
|
|
|
2012-02-16 21:59:01 +01:00
|
|
|
private:
|
|
|
|
PlayersTableHelper *m_helper;
|
2008-01-20 19:40:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|