示例#1
0
        public FFXIVMemoryObserver(FFXIVMemoryReader memoryReader)
        {
            this.memoryReader = memoryReader;

            FFXIVItemSet itemSet = memoryReader.ReadItemSet();

            this.equippedMainHandLightAmount = itemSet.Weapon.LightAmount;
            this.equippedOffHandLightAmount  = itemSet.Shield.LightAmount;
            this.equippedMainHandID          = itemSet.Weapon.ID;
            this.equippedOffHandID           = itemSet.Shield.ID;
            this.currentMahatma       = itemSet.Weapon.CurrentMahatma;
            this.currentMahatmaChange = itemSet.Weapon.CurrentMahatma.Charge;

            this.timer = new Timer(this.OnTimerElapsed, null, 500, 500);
        }
示例#2
0
        private void OnTimerElapsed(object state)
        {
            if (!this.MemoryReader.Process.HasExited)
            {
                FFXIVItemSet itemSet = memoryReader.ReadItemSet();

                this.EquippedMainHandID          = itemSet.Weapon.ID;
                this.EquippedOffHandID           = itemSet.Shield.ID;
                this.EquippedMainHandLightAmount = itemSet.Weapon.LightAmount;
                this.EquippedOffHandLightAmount  = itemSet.Shield.LightAmount;
                this.CurrentMahatmaChange        = itemSet.Weapon.CurrentMahatma.Charge;
                this.CurrentMahatma = itemSet.Weapon.CurrentMahatma;
            }
            else
            {
                this.timer.Dispose();
            }
        }