示例#1
0
        public bool RemoveRule(uint classA, uint classB)
        {
            CollisionRuleEntry toRemove = null;

            foreach (CollisionRuleEntry rule in _rules)
            {
                if (rule.Involves(classA, classB))
                {
                    toRemove = rule;
                }
            }
            if (null != toRemove)
            {
                _rules.Remove(toRemove);
                return(true);
            }
            return(false);
        }
示例#2
0
        public bool CanCollide(uint classA, uint classB, out CollisionRuleEntry collisionRule)
        {
            collisionRule = null;

            if ((0 == classA) || (0 == classB))
            {
                return(false);
            }

            foreach (CollisionRuleEntry rule in _rules)
            {
                if (rule.Involves(classA, classB))
                {
                    collisionRule = rule;
                    return(true);
                }
            }
            return(false);
        }
示例#3
0
 public bool CanCollide(uint classA, uint classB, out CollisionRuleEntry collisionRuleEntry)
 {
     collisionRuleEntry = null;
     return(CanCollide(classA, classB));
 }