Cleanup some schedules

This commit is contained in:
smoogipoo 2019-05-09 13:33:18 +09:00
parent c69d813745
commit 3fed165b74

View File

@ -77,13 +77,13 @@ namespace osu.Game.Online.API
/// <param name="component"></param>
public void Register(IOnlineComponent component)
{
Scheduler.Add(delegate { components.Add(component); });
Schedule(() => components.Add(component));
component.APIStateChanged(this, state);
}
public void Unregister(IOnlineComponent component)
{
Scheduler.Add(delegate { components.Remove(component); });
Schedule(() => components.Remove(component));
}
public string AccessToken => authentication.RequestAccessToken();
@ -274,7 +274,7 @@ namespace osu.Game.Online.API
state = value;
log.Add($@"We just went {state}!");
Scheduler.Add(delegate
Schedule(() =>
{
components.ForEach(c => c.APIStateChanged(this, state));
OnStateChange?.Invoke(oldState, state);