コード例 #1
0
 private void OnConditionChange(ConditionFlag flag, bool value)
 {
     if (Config.CombatStart && flag == ConditionFlag.InCombat && value)
     {
         SetLock(true);
     }
 }
コード例 #2
0
ファイル: Branchements.cs プロジェクト: nvareille/KhelljyrVM
        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);
        }
コード例 #3
0
        public override void Deserialize(IGenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            m_Flags = (ConditionFlag)reader.ReadInt();
        }
コード例 #4
0
 protected void SetFlag(ConditionFlag flag, bool value)
 {
     if (value)
     {
         m_Flags |= flag;
     }
     else
     {
         m_Flags &= ~flag;
     }
 }
コード例 #5
0
ファイル: Condition.cs プロジェクト: illion20/Dalamud
        /// <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));
            }
        }
コード例 #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;
            }
        }
コード例 #7
0
ファイル: Branchements.cs プロジェクト: nvareille/KhelljyrVM
        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());
        }
コード例 #8
0
 protected bool GetFlag(ConditionFlag flag)
 {
     return((m_Flags & flag) != 0);
 }
コード例 #9
0
ファイル: Teleporter.cs プロジェクト: Crome696/ServUO
		protected void SetFlag(ConditionFlag flag, bool value)
		{
			if (value)
			{
				m_Flags |= flag;
			}
			else
			{
				m_Flags &= ~flag;
			}
		}
コード例 #10
0
ファイル: Teleporter.cs プロジェクト: Crome696/ServUO
		protected bool GetFlag(ConditionFlag flag)
		{
			return ((m_Flags & flag) != 0);
		}
コード例 #11
0
ファイル: Teleporter.cs プロジェクト: Crome696/ServUO
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			m_Flags = (ConditionFlag)reader.ReadInt();
		}
コード例 #12
0
ファイル: Condition.cs プロジェクト: r1ft4469/Dalamud
 /// <inheritdoc cref="this[int]"/>
 public unsafe bool this[ConditionFlag flag]
 => this[(int)flag];
コード例 #13
0
ファイル: Teleporter.cs プロジェクト: FreeReign/forkuo
 protected void SetFlag(ConditionFlag flag, bool value)
 {
     if (value)
         this.m_Flags |= flag;
     else
         this.m_Flags &= ~flag;
 }