#pragma once #include "CDTable.h" #include "dCommonVars.h" #include #include // A modular build (rocket, car): ModularBuildComponent with what DLU needs from its xml struct CDModularBuildComponent { uint32_t id{}; int32_t buildType{}; LOT createdLOT{ LOT_NULL }; // the item the finished build becomes uint32_t numberOfParts{}; // LOT rootPartExampleLOT{ LOT_NULL }; // of the module whose PartCode is }; class CDModularBuildComponentTable : public CDTable> { public: void LoadValuesFromDatabase(); // The first build made of this many parts std::optional GetByNumberOfParts(uint32_t numberOfParts) const; // Whether a LOT is the item some build becomes (a car or rocket) bool IsCreatedLot(LOT lot) const; // Fills numberOfParts and rootPartExampleLOT from a ModularBuildComponent.xml static void ParseXml(std::string_view xml, CDModularBuildComponent& build); static std::optional FindByNumberOfParts(const std::vector& builds, uint32_t numberOfParts); };