public void OnMapUpdate(MapSettingEvent @event) { switch (@event.Setting) { case MapSettings.ApproachRate: @event.Value = (float)ApproachRateModValue; @event.Canceled = !ApproachRateModEnabled; break; case MapSettings.CircleSize: @event.Value = (float)CircleSizeModValue; @event.Canceled = !CircleSizeModEnabled; break; case MapSettings.OverallDifficulty: @event.Value = (float)OverallDifficultyModValue; @event.Canceled = !OverallDifficulyModEnabled; break; case MapSettings.DoubletimeSpeed: @event.Canceled = true; break; default: throw new ArgumentOutOfRangeException(); } }
private static float GetWithEvent(MapSettings setting, float value) { var _event = new MapSettingEvent(setting, value); EventManager.Invoke(_event); return(_event.Canceled ? value : _event.Value); }