| 46 | } |
| 47 | |
| 48 | Json WeatherType::toJson() const { |
| 49 | return JsonObject{{"name", name}, |
| 50 | {"particles", |
| 51 | particles.transformed([](ParticleConfig const& pc) -> Json { |
| 52 | return JsonObject{ |
| 53 | {"particle", pc.particle.toJson()}, {"density", pc.density}, {"autoRotate", pc.autoRotate}}; |
| 54 | })}, |
| 55 | {"projectiles", |
| 56 | projectiles.transformed([](ProjectileConfig const& pc) -> Json { |
| 57 | return JsonObject{{"projectile", pc.projectile}, |
| 58 | {"parameters", pc.parameters}, |
| 59 | {"velocity", jsonFromVec2F(pc.velocity)}, |
| 60 | {"ratePerX", pc.ratePerX}, |
| 61 | {"spawnAboveRegion", pc.spawnAboveRegion}, |
| 62 | {"spawnHorizontalPad", pc.spawnHorizontalPad}, |
| 63 | {"windAffectAmount", pc.windAffectAmount}}; |
| 64 | })}, |
| 65 | {"maximumWind", maximumWind}, |
| 66 | {"duration", jsonFromVec2F(duration)}, |
| 67 | {"weatherNoises", jsonFromStringList(weatherNoises)}, |
| 68 | {"statusEffects", jsonFromStringList(statusEffects)}}; |
| 69 | } |
| 70 | |
| 71 | DataStream& operator>>(DataStream& ds, WeatherType& weatherType) { |
| 72 | ds.read(weatherType.name); |
nothing calls this directly
no test coverage detected