mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
refs #720, moved data consolidation with DB data into own class in BlackCore
(in blackcore I can access the readers)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
f9922353c4
commit
d75b105ee3
@@ -14,25 +14,6 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
int CAircraftModelUtilities::mergeWithDbData(CAircraftModelList &modelToBeModified, const CAircraftModelList &dbModels, bool force)
|
||||
{
|
||||
if (dbModels.isEmpty() || modelToBeModified.isEmpty()) { return 0; }
|
||||
int c = 0;
|
||||
for (CAircraftModel &simModel : modelToBeModified)
|
||||
{
|
||||
if (!force && simModel.hasValidDbKey()) { continue; } // already done
|
||||
CAircraftModel dbModel(dbModels.findFirstByModelStringOrDefault(simModel.getModelString()));
|
||||
if (!dbModel.hasValidDbKey())
|
||||
{
|
||||
continue; // not found
|
||||
}
|
||||
dbModel.updateMissingParts(simModel, false);
|
||||
simModel = dbModel;
|
||||
c++;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
bool CAircraftModelUtilities::mergeWithVPilotData(CAircraftModelList &modelToBeModified, const CAircraftModelList &vPilotModels, bool force)
|
||||
{
|
||||
if (vPilotModels.isEmpty() || modelToBeModified.isEmpty()) { return false; }
|
||||
|
||||
Reference in New Issue
Block a user