| 141 | } |
| 142 | |
| 143 | std::unique_ptr<S5::GameState> exportGameState(const OpenLoco::GameState& src) |
| 144 | { |
| 145 | auto dst = std::make_unique<S5::GameState>(); |
| 146 | dst->general = exportGeneralState(src); |
| 147 | for (auto i = 0U; i < std::size(src.companies); i++) |
| 148 | { |
| 149 | dst->companies[i] = exportCompany(src.companies[i]); |
| 150 | } |
| 151 | for (auto i = 0U; i < std::size(src.towns); i++) |
| 152 | { |
| 153 | dst->towns[i] = exportTown(src.towns[i]); |
| 154 | } |
| 155 | for (auto i = 0U; i < std::size(src.industries); i++) |
| 156 | { |
| 157 | dst->industries[i] = exportIndustry(src.industries[i]); |
| 158 | } |
| 159 | for (auto i = 0U; i < std::size(src.stations); i++) |
| 160 | { |
| 161 | dst->stations[i] = exportStation(src.stations[i]); |
| 162 | } |
| 163 | for (auto i = 0U; i < std::size(src.entities); i++) |
| 164 | { |
| 165 | dst->entities[i] = exportEntity(src.entities[i]); |
| 166 | } |
| 167 | for (auto i = 0U; i < std::size(src.animations); i++) |
| 168 | { |
| 169 | dst->animations[i] = exportAnimation(src.animations[i]); |
| 170 | } |
| 171 | for (auto i = 0U; i < std::size(src.waves); i++) |
| 172 | { |
| 173 | dst->waves[i] = exportWave(src.waves[i]); |
| 174 | } |
| 175 | for (auto i = 0U; i < Limits::kMaxUserStrings; i++) |
| 176 | { |
| 177 | std::ranges::copy(src.userStrings[i], dst->userStrings[i]); |
| 178 | } |
| 179 | for (auto i = 0U; i < Limits::kMaxVehicles; i++) |
| 180 | { |
| 181 | std::ranges::copy(src.routings[i], dst->routings[i]); |
| 182 | } |
| 183 | std::ranges::copy(src.orders, dst->orders); |
| 184 | return dst; |
| 185 | } |
| 186 | |
| 187 | std::unique_ptr<S5::GameState> importGameStateType2(const S5::GameStateType2& src) |
| 188 | { |
nothing calls this directly
no test coverage detected