Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
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();
            }
        }
Exemplo n.º 3
0
        public void SetSpecialFlag(TravelRules flag, bool value)
        {
            if (value)
            {
                if (CheckIllegalFlagCombination(flag))
                {
                    return;
                }
            }

            if (value)
            {
                m_SpecialAccess |= flag;
            }
            else
            {
                m_SpecialAccess &= ~flag;
            }
        }
Exemplo n.º 4
0
 public bool GetSpecialFlag(TravelRules flag)
 {
     return((m_SpecialAccess & flag) != 0);
 }
Exemplo n.º 5
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();
		}
Exemplo n.º 6
0
		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;
		}
Exemplo n.º 7
0
		public void SetSpecialFlag(TravelRules flag, bool value)
		{
			if (value)
			{
				if (CheckIllegalFlagCombination(flag))
				{
					return;
				}
			}

			if (value)
				m_SpecialAccess |= flag;
			else
				m_SpecialAccess &= ~flag;
		}
Exemplo n.º 8
0
		public bool GetSpecialFlag(TravelRules flag)
		{
			return ((m_SpecialAccess & flag) != 0);
		}