1/**********************************************************************************
2 This file is part of the game 'KTron'
3
4 Copyright (C) 1998-2000 by Matthias Kiefer <matthias.kiefer@gmx.de>
5 Copyright (C) 2005 Benjamin C. Meyer <ben at meyerhome dot net>
6 Copyright (C) 2008-2009 Stas Verberkt <legolas at legolasweb dot nl>
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
22 *******************************************************************************/
23#include <KApplication>
24#include <KCmdLineArgs>
25#include <KAboutData>
26#include <KStandardDirs>
27
28#include "ktron.h"
29#include "renderer.h"
30#include "settings.h"
31#include "version.h"
32
33static KLocalizedString description = ki18n("A race in hyperspace");
34static KLocalizedString notice = ki18n("(c) 1998-2000, Matthias Kiefer\n"
35"(c) 2005, Benjamin Meyer\n"
36"(c) 2008-2009, Stas Verberkt\n"
37"\n"
38"Parts of the algorithms for the computer player are from\n"
39"xtron-1.1 by Rhett D. Jacobs <rhett@hotel.canberra.edu.au>");
40
41
42int main(int argc, char* argv[])
43{
44 KAboutData aboutData( "ktron", 0, ki18n("KSnakeDuel"),
45 KTRON_VERSION, description, KAboutData::License_GPL, notice);
46 aboutData.addAuthor(ki18n("Matthias Kiefer"), ki18n("Original author"), "matthias.kiefer@gmx.de");
47 aboutData.addAuthor(ki18n("Benjamin Meyer"), ki18n("Various improvements"), "ben+ktron@meyerhome.net");
48 aboutData.addAuthor(ki18n("Stas Verberkt"), ki18n("KDE 4 Port, interface revision and KSnake mode"), "legolas@legolasweb.nl");
49
50 KCmdLineArgs::init( argc, argv, &aboutData );
51
52 KCmdLineOptions options;
53 options.add("snake", ki18n("Start in KSnake mode"));
54 KCmdLineArgs::addCmdLineOptions(options);
55
56 KApplication a;
57 KGlobal::locale()->insertCatalog( QLatin1String( "libkdegames" ));
58 KStandardDirs::locateLocal("appdata", QLatin1String( "themes/" ));
59
60 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
61 if (args->isSet("snake"))
62 {
63 Settings::setGameType(Settings::EnumGameType::Snake);
64 }
65 else if (Settings::gameType() == Settings::EnumGameType::Snake)
66 {
67 Settings::setGameType(Settings::EnumGameType::PlayerVSComputer);
68 }
69
70 Renderer::self(); // Creates Renderer
71
72 KTron *ktron = new KTron();
73 ktron->show();
74
75 return a.exec();
76}
77
78