private void OnConditionChange(ConditionFlag flag, bool value) { if (Config.CombatStart && flag == ConditionFlag.InCombat && value) { SetLock(true); } }
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); }
public override void Deserialize(IGenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Flags = (ConditionFlag)reader.ReadInt(); }
protected void SetFlag(ConditionFlag flag, bool value) { if (value) { m_Flags |= flag; } else { m_Flags &= ~flag; } }
/// <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)); } }
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; } }
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()); }
protected bool GetFlag(ConditionFlag flag) { return((m_Flags & flag) != 0); }
protected bool GetFlag(ConditionFlag flag) { return ((m_Flags & flag) != 0); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Flags = (ConditionFlag)reader.ReadInt(); }
/// <inheritdoc cref="this[int]"/> public unsafe bool this[ConditionFlag flag] => this[(int)flag];
protected void SetFlag(ConditionFlag flag, bool value) { if (value) this.m_Flags |= flag; else this.m_Flags &= ~flag; }