private void OnConditionChange(ConditionFlag flag, bool value)
 {
     if (Config.CombatStart && flag == ConditionFlag.InCombat && value)
     {
         SetLock(true);
     }
 }
Exemple #2
0
        public static bool ConditionChecker(ConditionFlag flag, int a, int b)
        {
            bool result = false;

            switch (flag)
            {
            case ConditionFlag.Equals:
                result = a == b;
                break;

            case ConditionFlag.NotEquals:
                result = a != b;
                break;

            case ConditionFlag.Greater:
                result = a > b;
                break;

            case ConditionFlag.GreaterEquals:
                result = a >= b;
                break;

            case ConditionFlag.Lower:
                result = a < b;
                break;

            case ConditionFlag.LowerEquals:
                result = a <= b;
                break;
            }

            return(result);
        }
Exemple #3
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Flags = (ConditionFlag)reader.ReadInt();
        }
Exemple #4
0
 protected void SetFlag(ConditionFlag flag, bool value)
 {
     if (value)
     {
         m_Flags |= flag;
     }
     else
     {
         m_Flags &= ~flag;
     }
 }
Exemple #5
0
        /// <summary>
        /// Check the value of a specific condition/state flag.
        /// </summary>
        /// <param name="flag">The condition flag to check.</param>
        public unsafe bool this[ConditionFlag flag]
        {
            get
            {
                var idx = (int)flag;

                if (idx > MaxConditionEntries || idx < 0)
                {
                    return(false);
                }

                return(*(bool *)(this.ConditionArrayBase + idx));
            }
        }
Exemple #6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
                DisableMessage = reader.ReadBool();
                goto case 0;

            case 0:
                m_Flags = (ConditionFlag)reader.ReadInt();
                break;
            }
        }
Exemple #7
0
        public static int If(Processor proc, ProgramReader reader)
        {
            ConditionFlag flag    = (ConditionFlag)reader.NextInt();
            uint          address = reader.NextPtr();

            int a = BitConverter.ToInt32(proc.Registers.ConditionRegisters[0]);
            int b = BitConverter.ToInt32(proc.Registers.ConditionRegisters[1]);

            bool result = ConditionChecker(flag, a, b);

            if (result)
            {
                proc.ActiveStackContainer.ProgramCounter = (int)address;
                proc.Registers.JumpCarry = true;
                return(0);
            }

            return(reader.Elapsed());
        }
Exemple #8
0
 protected bool GetFlag(ConditionFlag flag)
 {
     return((m_Flags & flag) != 0);
 }
Exemple #9
0
		protected void SetFlag(ConditionFlag flag, bool value)
		{
			if (value)
			{
				m_Flags |= flag;
			}
			else
			{
				m_Flags &= ~flag;
			}
		}
Exemple #10
0
		protected bool GetFlag(ConditionFlag flag)
		{
			return ((m_Flags & flag) != 0);
		}
Exemple #11
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			m_Flags = (ConditionFlag)reader.ReadInt();
		}
Exemple #12
0
 /// <inheritdoc cref="this[int]"/>
 public unsafe bool this[ConditionFlag flag]
 => this[(int)flag];
Exemple #13
0
 protected void SetFlag(ConditionFlag flag, bool value)
 {
     if (value)
         this.m_Flags |= flag;
     else
         this.m_Flags &= ~flag;
 }