mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
allow for creating isolated segments outside track definition
This commit is contained in:
3
Track.h
3
Track.h
@@ -303,6 +303,9 @@ public:
|
|||||||
for (TIsolated *iso : Isolated)
|
for (TIsolated *iso : Isolated)
|
||||||
iso->Modify(i, o); }; // dodanie lub odjęcie osi
|
iso->Modify(i, o); }; // dodanie lub odjęcie osi
|
||||||
std::string RemoteIsolatedName();
|
std::string RemoteIsolatedName();
|
||||||
|
void AddIsolated(TIsolated *iso) {
|
||||||
|
Isolated.push_back(iso);
|
||||||
|
}
|
||||||
double WidthTotal();
|
double WidthTotal();
|
||||||
bool IsGroupable();
|
bool IsGroupable();
|
||||||
int TestPoint( Math3D::vector3 *Point);
|
int TestPoint( Math3D::vector3 *Point);
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
|
|||||||
std::string,
|
std::string,
|
||||||
deserializefunction> > functionlist = {
|
deserializefunction> > functionlist = {
|
||||||
{ "area", &state_serializer::deserialize_area },
|
{ "area", &state_serializer::deserialize_area },
|
||||||
|
{ "isolated", &state_serializer::deserialize_isolated },
|
||||||
{ "assignment", &state_serializer::deserialize_assignment },
|
{ "assignment", &state_serializer::deserialize_assignment },
|
||||||
{ "atmo", &state_serializer::deserialize_atmo },
|
{ "atmo", &state_serializer::deserialize_atmo },
|
||||||
{ "camera", &state_serializer::deserialize_camera },
|
{ "camera", &state_serializer::deserialize_camera },
|
||||||
@@ -149,6 +150,22 @@ state_serializer::deserialize_continue(std::shared_ptr<deserializer_state> state
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
state_serializer::deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad ) {
|
||||||
|
// first parameter specifies name of parent piece...
|
||||||
|
auto token { Input.getToken<std::string>() };
|
||||||
|
auto *groupowner { TIsolated::Find( token ) };
|
||||||
|
// ...followed by list of its tracks
|
||||||
|
while( ( false == ( token = Input.getToken<std::string>() ).empty() )
|
||||||
|
&& ( token != "endisolated" ) ) {
|
||||||
|
auto *track { simulation::Paths.find( token ) };
|
||||||
|
if( track != nullptr )
|
||||||
|
track->AddIsolated( groupowner );
|
||||||
|
else
|
||||||
|
ErrorLog( "Bad scenario: track \"" + token + "\" not found" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
state_serializer::deserialize_area( cParser &Input, scene::scratch_data &Scratchpad ) {
|
state_serializer::deserialize_area( cParser &Input, scene::scratch_data &Scratchpad ) {
|
||||||
// first parameter specifies name of parent piece...
|
// first parameter specifies name of parent piece...
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ private:
|
|||||||
// methods
|
// methods
|
||||||
// restores class data from provided stream
|
// restores class data from provided stream
|
||||||
void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_area( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
|
void deserialize_isolated( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_assignment( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_atmo( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
void deserialize_camera( cParser &Input, scene::scratch_data &Scratchpad );
|
||||||
|
|||||||
Reference in New Issue
Block a user