MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / importGameStateType2

Function importGameStateType2

src/OpenLoco/src/S5/S5GameState.cpp:187–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 }
186
187 std::unique_ptr<S5::GameState> importGameStateType2(const S5::GameStateType2& src)
188 {
189 auto dst = std::make_unique<S5::GameState>();
190 dst->general = src.general;
191 for (auto i = 0U; i < std::size(src.companies); i++)
192 {
193 dst->companies[i] = importCompanyType2(src.companies[i]);
194 }
195 std::ranges::copy(src.towns, dst->towns);
196 std::ranges::copy(src.industries, dst->industries);
197 std::ranges::copy(src.stations, dst->stations);
198 std::ranges::copy(src.entities, dst->entities);
199 std::ranges::copy(src.animations, dst->animations);
200 std::ranges::copy(src.waves, dst->waves);
201 for (auto i = 0U; i < Limits::kMaxUserStrings; i++)
202 {
203 std::ranges::copy(src.userStrings[i], dst->userStrings[i]);
204 }
205 for (auto i = 0U; i < Limits::kMaxVehicles; i++)
206 {
207 std::ranges::copy(src.routings[i], dst->routings[i]);
208 }
209 std::ranges::copy(src.orders, dst->orders);
210 return dst;
211 }
212
213 static OpenLoco::Scenario::Construction importConstruction(const S5::Construction& src)
214 {

Callers 1

loadSaveFunction · 0.85

Calls 1

importCompanyType2Function · 0.85

Tested by

no test coverage detected