16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 00:09:18 +02:00

build 200914. articulated coupler parameters change, driver aid logic tweak, sound overrides support, combined rain sound support

This commit is contained in:
tmj-fstate
2020-09-20 17:22:04 +02:00
parent ac1253826f
commit 4da87e98d9
15 changed files with 122 additions and 12 deletions

View File

@@ -353,6 +353,19 @@ deserialize_random_set( cParser &Input, char const *Break = "\n\r\t ;" );
int count_trailing_zeros( uint32_t val );
// extracts a group of <key, value> pairs from provided data stream
// NOTE: expects no more than single pair per line
template <typename MapType_>
void
deserialize_map( MapType_ &Map, cParser &Input ) {
while( Input.ok() && !Input.eof() ) {
auto const key { Input.getToken<typename MapType_::key_type>( false ) };
auto const value { Input.getToken<typename MapType_::mapped_type>( false, "\n" ) };
Map.emplace( key, value );
}
}
namespace threading {
// simple POD pairing of a data item and a mutex