#include "spdlog.h"
#include "widget.h"

#include <QApplication>
#include "loginit.h"

#include "AbstractFactory/AbstractFactory.h"
#include "Builder/Builder.h"
#include "Prototype/Prototype.h"
#include "Adapter/Adapter.h"


int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    init_log();
    
    /* 建造一艘旗舰战船 */
    // AbstractFactory* factory = new FactoryUltimate();
    // Ship* ship = factory->createShip();
    // ship->showShip();
    // delete ship;

    /* 创建6中不同的船 */
    // buildSunnyShip();
    // SPDLOG_INFO("==============================================");
    // buildMerryShip();

    // Soldier66* soldier66 = new Soldier66();
    // soldier66->show();
    // GermaSoldier* soldier66_clone = soldier66->clone();
    // soldier66_clone->show();
    // delete soldier66;
    // delete soldier66_clone;

    Foreigner* american = new American();
    AbstractTranslator* translator = new EnglishAdapter(american);
    translator->translateToPanda();
    translator->translateToForeigner();
    delete translator;
    delete american;

    Foreigner* french = new French();
    translator = new FrenchAdapter(french);
    translator->translateToPanda();
    translator->translateToForeigner();
    delete translator;
    delete french;

    return a.exec();
}
