void SaveRefractionEffects(IValueWriter w) { w.WriteStartNode(_refractionEffectsNodeName); { var validFx = _refractionEffects.Where(x => RefractionEffectFactory.IsValidType(x.GetType())).ToImmutable(); w.WriteManyNodes(_refractionEffectListNodeName, validFx, RefractionEffectFactory.Write); } w.WriteEndNode(_refractionEffectsNodeName); }
void SaveRefractionEffects(IValueWriter w, MapSaveFlags saveFlags) { var validFx = _refractionEffects.Where(x => RefractionEffectFactory.IsValidType(x.GetType())); if ((saveFlags & MapSaveFlags.DoNotSort) == 0) { validFx = validFx.OrderBy(x => x, new BasicSpatialComparer()); } validFx = validFx.ToImmutable(); w.WriteStartNode(_refractionEffectsNodeName); { w.WriteManyNodes(_refractionEffectListNodeName, validFx, RefractionEffectFactory.Write); } w.WriteEndNode(_refractionEffectsNodeName); }