private void WorldEndedHandler(object sender, WorldChangingEventArgs args) { if (args.Quit) { if (ReadyToQuit != null) { ReadyToQuit(this, EventArgs.Empty); } return; } if (!_worlds.ContainsKey(args.NewWorld)) { throw new InvalidOperationException("could not find world: " + args.NewWorld); } if (CurrentWorldChanging != null) { CurrentWorldChanging(this, args); } if (args.Cancel) { return; } SetCurrentWorld(args.NewWorld); }
private void WorldEndedHandler(object sender, WorldChangingEventArgs args) { if (args.Quit) { if (ReadyToQuit != null) ReadyToQuit(this, EventArgs.Empty); return; } if (!_worlds.ContainsKey(args.NewWorld)) throw new InvalidOperationException("could not find world: " + args.NewWorld); if (CurrentWorldChanging != null) CurrentWorldChanging(this, args); if (args.Cancel) return; SetCurrentWorld(args.NewWorld); }