public void Handle(Chaos mod, String from, IEnumerable <String> rest) { var r = rest.GetEnumerator(); if (!r.MoveNext()) { return; } String what = null; DisabledControl control = DisabledControl.Steering; var id = r.Current; switch (id) { case "steering": control = DisabledControl.Steering; what = "Steering"; break; default: throw new Exception($"bad disable-control id `{id}`"); } var timer = mod.Timer($"Disabled {what}", 10f); mod.AddTicker(new DisableControlTicker(timer, control)); mod.ShowText($"{from} disabled the {what} control!"); }
public DisableControlTicker(Timer timer, DisabledControl control) { this.timer = timer; this.control = control; }