public WeatherParticle(World world, CPos position, WeatherEffect effect) { this.world = world; Position = position; isQuad = effect.Type == WeatherEffectType.SNOW; color = effect.Color + variety(effect.ColorVariety); size = (int)Math.Max(0, effect.Size + variety(effect.RandomSize)); velocity = effect.Velocity + variety(effect.RandomVelocity); }
public WeatherEffectController(World world, WeatherEffect effect) { this.effect = effect; var particleCount = effect.Particles * 2; particles = new WeatherParticle[particleCount]; for (int i = 0; i < particleCount; i++) { particles[i] = new WeatherParticle(world, randomPosition(), effect); } }