| 19 | } |
| 20 | |
| 21 | static S5::GeneralState exportGeneralState(const OpenLoco::GameState& src) |
| 22 | { |
| 23 | S5::GeneralState dst{}; |
| 24 | dst.rng[0] = src.rng.srand_0(); |
| 25 | dst.rng[1] = src.rng.srand_1(); |
| 26 | dst.unkRng[0] = src.unkRng.srand_0(); |
| 27 | dst.unkRng[1] = src.unkRng.srand_1(); |
| 28 | dst.flags = enumValue(src.flags); |
| 29 | dst.currentDay = src.currentDay; |
| 30 | dst.dayCounter = src.dayCounter; |
| 31 | dst.currentYear = src.currentYear; |
| 32 | dst.currentMonth = src.currentMonth; |
| 33 | dst.currentDayOfMonth = src.currentDayOfMonth; |
| 34 | dst.savedViewX = src.savedViewX; |
| 35 | dst.savedViewY = src.savedViewY; |
| 36 | dst.savedViewZoom = src.savedViewZoom; |
| 37 | dst.savedViewRotation = src.savedViewRotation; |
| 38 | dst.playerCompanies[0] = enumValue(src.playerCompanies[0]); |
| 39 | dst.playerCompanies[1] = enumValue(src.playerCompanies[1]); |
| 40 | |
| 41 | for (auto i = 0U; i < std::size(src.entityListHeads); ++i) |
| 42 | { |
| 43 | dst.entityListHeads[i] = enumValue(src.entityListHeads[i]); |
| 44 | } |
| 45 | std::ranges::copy(src.entityListCounts, dst.entityListCounts); |
| 46 | std::ranges::copy(src.currencyMultiplicationFactor, dst.currencyMultiplicationFactor); |
| 47 | std::ranges::copy(src.unusedCurrencyMultiplicationFactor, dst.unusedCurrencyMultiplicationFactor); |
| 48 | dst.scenarioTicks = src.scenarioTicks; |
| 49 | dst.var_014A = src.var_014A; |
| 50 | dst.scenarioTicks2 = src.scenarioTicks2; |
| 51 | dst.magicNumber = kMagicNumber; // Match implementation at 0x004437FC |
| 52 | dst.numMapAnimations = src.numMapAnimations; |
| 53 | dst.tileUpdateStartLocation = src.tileUpdateStartLocation; |
| 54 | dst.scenarioConstruction = exportConstruction(src.scenarioConstruction); |
| 55 | dst.lastRailroadOption = src.lastRailroadOption; |
| 56 | dst.lastRoadOption = src.lastRoadOption; |
| 57 | dst.lastAirport = src.lastAirport; |
| 58 | dst.lastShipPort = src.lastShipPort; |
| 59 | dst.trafficHandedness = src.trafficHandedness; |
| 60 | dst.lastVehicleType = enumValue(src.lastVehicleType); |
| 61 | dst.pickupDirection = src.pickupDirection; |
| 62 | dst.lastTreeOption = src.lastTreeOption; |
| 63 | dst.seaLevel = src.seaLevel; |
| 64 | dst.currentSnowLine = src.currentSnowLine; |
| 65 | dst.currentSeason = enumValue(src.currentSeason); |
| 66 | dst.lastLandOption = src.lastLandOption; |
| 67 | dst.maxCompetingCompanies = src.maxCompetingCompanies; |
| 68 | dst.orderTableLength = src.orderTableLength; |
| 69 | dst.roadObjectIdIsAnyRoadTypeCompatible = src.roadObjectIdIsAnyRoadTypeCompatible; |
| 70 | dst.roadObjectIdIsUsableByAllCompanies = src.roadObjectIdIsUsableByAllCompanies; |
| 71 | dst.currentDefaultLevelCrossingType = src.currentDefaultLevelCrossingType; |
| 72 | dst.lastTrackTypeOption = src.lastTrackTypeOption; |
| 73 | dst.loanInterestRate = src.loanInterestRate; |
| 74 | dst.lastIndustryOption = src.lastIndustryOption; |
| 75 | dst.lastBuildingOption = src.lastBuildingOption; |
| 76 | dst.lastMiscBuildingOption = src.lastMiscBuildingOption; |
| 77 | dst.lastWallOption = src.lastWallOption; |
| 78 | dst.produceAICompanyTimeout = src.produceAICompanyTimeout; |
no test coverage detected