You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdegames/kenolaba/kenolaba.cpp

72 lines
1.7 KiB

/* Start point */
#include <tqobject.h>
#include <tdeapplication.h>
#include <tdelocale.h>
#include <tdeglobal.h>
#include <tdecmdlineargs.h>
#include <tdeaboutdata.h>
#include "version.h"
#include "AbTop.h"
static const char description[] =
I18N_NOOP("Board game inspired by Abalone");
static TDECmdLineOptions options[] =
{
{ "h", 0, 0},
{ "host <host>", I18N_NOOP("Use 'host' for network game"), 0 },
{ "p", 0, 0},
{ "port <port>", I18N_NOOP("Use 'port' for network game"), 0 },
TDECmdLineLastOption
};
AbTop *create(TDECmdLineArgs *args)
{
AbTop* top = new AbTop;
if (args->isSet("port"))
top->netPort( args->getOption("port").toInt() );
if (args->isSet("host"))
top->netHost( args->getOption("host").data() );
top->readConfig();
return top;
}
int main(int argc, char *argv[])
{
TDEAboutData aboutData( "kenolaba", I18N_NOOP("Kenolaba"),
KENOLABA_VERSION, description, TDEAboutData::License_GPL,
"(c) 1997-2000, Josef Weidendorfer");
aboutData.addAuthor("Josef Weidendorfer",0, "Josef.Weidendorfer@gmx.de");
aboutData.addAuthor("Robert Williams");
TDECmdLineArgs::init( argc, argv, &aboutData );
TDECmdLineArgs::addCmdLineOptions( options ); // Add our own options.
TDEApplication app;
TDEGlobal::locale()->insertCatalogue("libtdegames");
/* command line handling */
TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
/* session management */
if ( app.isRestored() ) {
uint n = 1;
while ( TDEMainWindow::canBeRestored(n) ) {
AbTop *top = create(args);
top->restore(n);
n++;
}
} else {
AbTop *top = create(args);
app.setMainWidget(top);
top->show();
}
args->clear();
return app.exec();
}