private bool CheckIllegalFlagCombination(TravelRules flag) { TravelRules temp = m_SpecialAccess | flag; //can't have GhostOnly AND MortalsOnly if ((temp & TravelRules.GhostsOnly) != 0 && (temp & TravelRules.MortalsOnly) != 0) { return(true); } //No illegal flag combinations, return false return(false); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Target = reader.ReadPoint3D(); m_TargetMap = reader.ReadMap(); if (version >= 1) { m_bDispellable = reader.ReadBool(); } if (version >= 2) { m_SpecialAccess = (TravelRules)reader.ReadInt(); } }
public void SetSpecialFlag(TravelRules flag, bool value) { if (value) { if (CheckIllegalFlagCombination(flag)) { return; } } if (value) { m_SpecialAccess |= flag; } else { m_SpecialAccess &= ~flag; } }
public bool GetSpecialFlag(TravelRules flag) { return((m_SpecialAccess & flag) != 0); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Target = reader.ReadPoint3D(); m_TargetMap = reader.ReadMap(); if (version >= 1) m_bDispellable = reader.ReadBool(); if (version >= 2) m_SpecialAccess = (TravelRules)reader.ReadInt(); }
private bool CheckIllegalFlagCombination(TravelRules flag) { TravelRules temp = m_SpecialAccess | flag; //can't have GhostOnly AND MortalsOnly if ((temp & TravelRules.GhostsOnly) != 0 && (temp & TravelRules.MortalsOnly) != 0) { return true; } //No illegal flag combinations, return false return false; }
public void SetSpecialFlag(TravelRules flag, bool value) { if (value) { if (CheckIllegalFlagCombination(flag)) { return; } } if (value) m_SpecialAccess |= flag; else m_SpecialAccess &= ~flag; }
public bool GetSpecialFlag(TravelRules flag) { return ((m_SpecialAccess & flag) != 0); }