mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #358, split FSX driver and factory into different files
This commit is contained in:
@@ -33,16 +33,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
BlackCore::ISimulator *CSimulatorFsxFactory::create(QObject *parent)
|
||||
{
|
||||
return new Fsx::CSimulatorFsx(parent);
|
||||
}
|
||||
|
||||
BlackSim::CSimulatorInfo CSimulatorFsxFactory::getSimulatorInfo() const
|
||||
{
|
||||
return CSimulatorInfo::FSX();
|
||||
}
|
||||
|
||||
CSimulatorFsx::CSimulatorFsx(QObject *parent) :
|
||||
ISimulator(parent),
|
||||
m_simulatorInfo(CSimulatorInfo::FSX()),
|
||||
|
||||
35
src/plugins/simulator/fsx/simulator_fsxfactory.cpp
Normal file
35
src/plugins/simulator/fsx/simulator_fsxfactory.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "simulator_fsxfactory.h"
|
||||
#include "simulator_fsx.h"
|
||||
#include "blacksim/simulatorinfo.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include <QTimer>
|
||||
#include <QtConcurrent>
|
||||
|
||||
using namespace BlackSim;
|
||||
using namespace BlackCore;
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
BlackCore::ISimulator *CSimulatorFsxFactory::create(QObject *parent)
|
||||
{
|
||||
return new Fsx::CSimulatorFsx(parent);
|
||||
}
|
||||
|
||||
CSimulatorInfo CSimulatorFsxFactory::getSimulatorInfo() const
|
||||
{
|
||||
return CSimulatorInfo::FSX();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
45
src/plugins/simulator/fsx/simulator_fsxfactory.h
Normal file
45
src/plugins/simulator/fsx/simulator_fsxfactory.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMPLUGIN_SIMULATOR_FSXFACTORY_H
|
||||
#define BLACKSIMPLUGIN_SIMULATOR_FSXFACTORY_H
|
||||
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blacksim/simulatorinfo.h"
|
||||
|
||||
#include <simconnect/SimConnect.h>
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
{
|
||||
//! Factory implementation to create CSimulatorFsx instances
|
||||
class CSimulatorFsxFactory : public QObject, public BlackCore::ISimulatorFactory
|
||||
{
|
||||
Q_OBJECT
|
||||
// TODO: @RW, move this string into CProject please
|
||||
Q_PLUGIN_METADATA(IID "net.vatsim.PilotClient.BlackCore.SimulatorInterface")
|
||||
Q_INTERFACES(BlackCore::ISimulatorFactory)
|
||||
|
||||
public:
|
||||
//! \copydoc BlackCore::ISimulatorFactory::create
|
||||
virtual BlackCore::ISimulator *create(QObject *parent) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulatorFactory::getSimulatorInfo
|
||||
virtual BlackSim::CSimulatorInfo getSimulatorInfo() const override;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user