mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 07:29:20 +02:00
Every module unit now includes the standard headers it uses. Declarations reaching a unit only through an imported module's global module fragment are reachable but not visible, so ADL misses the free operators older libstdc++ declares beside a type - reproduced on ubuntu 24.04 (libstdc++ 13), where gl/vao.cpp could not compare vector iterators. Also drops a stale editor/editorSettings.hpp from the MSVC source list, which broke the Windows configure step, silences the deliberate include-in-purview warning in the glm wrapper, and removes GCC support: clang or MSVC only.
56 lines
1.7 KiB
C++
56 lines
1.7 KiB
C++
module;
|
|
#include <utility>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <sstream>
|
|
#include "vehicle/DynObj_macros.h"
|
|
|
|
module eu07.utilities.dictionary;
|
|
import eu07.utilities.utilities;
|
|
import eu07.simulation.simulation;
|
|
import eu07.simcore;
|
|
import eu07.world.mtable;
|
|
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
|
|
|
|
dictionary_source::dictionary_source( std::string const &Input ) {
|
|
|
|
auto const keyvaluepairs { Split( Input, '&' ) };
|
|
|
|
for( auto const &keyvaluepair : keyvaluepairs ) {
|
|
|
|
auto const valuepos { keyvaluepair.find( '=' ) };
|
|
if( keyvaluepair[ 0 ] != '$' ) {
|
|
// regular key, value pairs
|
|
insert(
|
|
ToLower( keyvaluepair.substr( 0, valuepos ) ),
|
|
keyvaluepair.substr( valuepos + 1 ) );
|
|
}
|
|
else {
|
|
// special case, $key indicates request to include certain dataset clarified by value
|
|
auto const key { ToLower( keyvaluepair.substr( 0, valuepos ) ) };
|
|
auto const value { keyvaluepair.substr( valuepos + 1 ) };
|
|
|
|
if( key == "$timetable" ) {
|
|
// timetable pulled from (preferably) the owner/direct controller of specified vehicle
|
|
auto const *vehicle { simulation::Vehicles.find( value ) };
|
|
auto const *controller { (
|
|
vehicle == nullptr ? nullptr :
|
|
vehicle->ctOwner == nullptr ? vehicle->Mechanik :
|
|
vehicle->ctOwner ) };
|
|
if( controller != nullptr ) {
|
|
controller->TrainTimetable().serialize( this );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|