Пример #1
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        // Internals
        ///////////////////////////////////////////////////////////////////////////////////////////

        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;

            this.Time              = new TimeSpan(0);
            this.RunTimer          = new Timer();
            this.RunTimer.Interval = 500;
            this.RunTimer.Elapsed += DispatcherTimer_Tick;

            // TODO: Drop-down menu to select game
            TheGame           = new Nutcracker();
            TheGame.OnUpdate += delegate(object o, GameUpdate update)
            {
                this.Dispatcher.Invoke(DispatcherPriority.Send, new Action(() => { UpdateSystem(o, update); }));
            };

            FFXIVMemory.InitializeMemory();
        }
Пример #2
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        // System Components
        ///////////////////////////////////////////////////////////////////////////////////////////

        private void UpdateSystem(object parent, GameUpdate update)
        {
            GameBase gameBase = (parent as GameBase);

            if (update.State == GameState.Initialized)
            {
                gameBase.InitCalled(update, this);
            }
            else if (update.State == GameState.Running)
            {
                gameBase.RunCalled(update, this);
            }
            else if (update.State == GameState.Finished)
            {
                gameBase.CloseCalled(update, this);

                this.RunTimer.Stop();
                this.Time = new TimeSpan(0);
            }
        }