Пример #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));
 }