mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 03:09:18 +02:00
basic scenery data export in legacy text format
This commit is contained in:
35
scene.cpp
35
scene.cpp
@@ -228,6 +228,17 @@ basic_cell::deserialize( std::istream &Input ) {
|
||||
|| ( false == m_lines.empty() ) );
|
||||
}
|
||||
|
||||
// sends content of the class in legacy (text) format to provided stream
|
||||
void
|
||||
basic_cell::export_as_text( std::ostream &Output ) const {
|
||||
|
||||
// text format export dumps only relevant basic objects
|
||||
// sounds
|
||||
for( auto const *sound : m_sounds ) {
|
||||
sound->export_as_text( Output );
|
||||
}
|
||||
}
|
||||
|
||||
// adds provided shape to the cell
|
||||
void
|
||||
basic_cell::insert( shape_node Shape ) {
|
||||
@@ -530,7 +541,7 @@ basic_cell::create_geometry( gfx::geometrybank_handle const &Bank ) {
|
||||
|
||||
// adjusts cell bounding area to enclose specified node
|
||||
void
|
||||
basic_cell::enclose_area( editor::basic_node *Node ) {
|
||||
basic_cell::enclose_area( scene::basic_node *Node ) {
|
||||
|
||||
m_area.radius = std::max(
|
||||
m_area.radius,
|
||||
@@ -645,6 +656,16 @@ basic_section::deserialize( std::istream &Input ) {
|
||||
}
|
||||
}
|
||||
|
||||
// sends content of the class in legacy (text) format to provided stream
|
||||
void
|
||||
basic_section::export_as_text( std::ostream &Output ) const {
|
||||
|
||||
// text format export dumps only relevant basic objects from non-empty cells
|
||||
for( auto const &cell : m_cells ) {
|
||||
cell.export_as_text( Output );
|
||||
}
|
||||
}
|
||||
|
||||
// adds provided shape to the section
|
||||
void
|
||||
basic_section::insert( shape_node Shape ) {
|
||||
@@ -949,6 +970,18 @@ basic_region::deserialize( std::string const &Scenariofile ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// sends content of the class in legacy (text) format to provided stream
|
||||
void
|
||||
basic_region::export_as_text( std::ostream &Output ) const {
|
||||
|
||||
for( auto *section : m_sections ) {
|
||||
// text format export dumps only relevant basic objects from non-empty sections
|
||||
if( section != nullptr ) {
|
||||
section->export_as_text( Output );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// legacy method, links specified path piece with potential neighbours
|
||||
void
|
||||
basic_region::TrackJoin( TTrack *Track ) {
|
||||
|
||||
Reference in New Issue
Block a user