summaryrefslogtreecommitdiffstats
path: root/kfouleggs/main.cpp
blob: 89295d086942585d2aef15dcc592b528a856b8bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include "main.h"
#include "main.moc"

#include <klocale.h>
#include <kapplication.h>
#include <khighscore.h>

#include "common/inter.h"
#include "common/highscores.h"
#include "prefs.h"
#include "piece.h"

//-----------------------------------------------------------------------------
const MPGameInfo MP_GAME_INFO = {
    "004", // multiplayer id (increase when incompatible changes are made)
    4,     // max nb local games
    500,   // interval
    true,  // IA allowed
    0, 0   // no setting slots
};

const MainData MAIN_DATA = {
    "kfouleggs",
    I18N_NOOP("KFoulEggs"),
    I18N_NOOP("KFoulEggs is an adaptation of the well-known\n(at least in "
              "Japan) PuyoPuyo game"),
    "http://kfouleggs.sourceforge.net/",
    I18N_NOOP("Puyos"),
    "2.1.11",
    "2.1.11 (12 September 2004)"
};

const uint HISTOGRAM_SIZE = 8;
const uint HISTOGRAM[HISTOGRAM_SIZE] = {
    1, 5000, 10000, 20000, 50000, 100000, 200000, 300000
};

const BaseBoardInfo BASE_BOARD_INFO = {
    6, 15, // width - height
    true, // with pieces

    150,  // before remove time
    10,   // after removed time
    3,    // nb toggles
    5,    // nb partial fall stages

    0,    // nb arcade stages

    HISTOGRAM, HISTOGRAM_SIZE, false, // score is not bound
};

const CommonBoardInfo COMMON_BOARD_INFO = {
    1000, // base time
    10,   // drop down time
    10,   // before glue time
    10,   // after glue time
    10,   // after gift time
    3,    // nb bump stages

    100,  // nb removed to level
    5, 6, 800, 2000 // nb leds, max to send, shower timeout, pool timeout
};

FEFactory::FEFactory()
    : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO)
{}

BaseInterface *FEFactory::createInterface(TQWidget *parent)
{
    return new Interface(MP_GAME_INFO, parent);
}


//-----------------------------------------------------------------------------
int main(int argc, char **argv)
{
    KHighscore::init(MAIN_DATA.appName);
    FEFactory fef;
    fef.init(argc, argv);

    FEPieceInfo pieceInfo;
    CommonHighscores highscores;
    (void) Prefs::self(); // Create preferences

    if ( kapp->isRestored() ) RESTORE(FEMainWindow)
    else {
        FEMainWindow *mw = new FEMainWindow;
        kapp->setMainWidget(mw);
        mw->show();
    }
	return kapp->exec();
}