summaryrefslogtreecommitdiffstats
path: root/libksirtet/common/factory.h
blob: c0b40d66dbfaa8adc0e6d6a22a7ac3d9852eb6e8 (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
#ifndef COMMON_FACTORY_H
#define COMMON_FACTORY_H

#include "base/factory.h"

#include "lib/libksirtet_export.h"

struct CommonBoardInfo {
    uint baseTime, dropDownTime, beforeGlueTime, afterGlueTime;
    uint afterGiftTime, nbBumpStages;
    uint nbRemovedToLevel;
    uint nbGiftLeds, maxGiftsToSend, giftShowerTimeout, giftPoolTimeout;
};

class BaseField;
class AI;

#define cfactory static_cast<CommonFactory *>(BaseFactory::self())

class LIBKSIRTET_EXPORT CommonFactory : public BaseFactory
{
 public:
    CommonFactory(const MainData &, const BaseBoardInfo &,
                  const CommonBoardInfo &);

    const CommonBoardInfo &cbi;

    virtual BaseField *createField(QWidget *parent) = 0;
    virtual AI *createAI() = 0;

    QWidget *createAIConfig();
    virtual QWidget *createAppearanceConfig();
    virtual QWidget *createGameConfig();
};

#endif