示例#1
0
        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);
        }
示例#2
0
        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);
        }