示例#1
0
 public ValidNeighbors(RulesGraph rules, LinkedListNode <string> node)
 {
     try
     {
         var ball = rules[node.Value];
         _result = ball.Balls.First(o => o.Name == node.Next.Value) != null;
     }
     catch (KeyNotFoundException)
     {
         _result = true;
     }
     catch (Exception)
     {
         _result = false;
     }
 }
示例#2
0
        public ValidNeighbors(RulesGraph rules, LinkedListNode<string> node)
        {
            try
            {
                var ball = rules[node.Value];

                if (!ball.Balls.Any())
                    _result = true;
                else
                    _result = ball.Balls.FirstOrDefault(o => o.Name == node.Next.Value) != null;
            }
            catch (KeyNotFoundException)
            {
                _result = true;
            }
            catch (NullReferenceException)
            {
                _result = true;
            }
            catch (Exception)
            {
                _result = false;
            }
        }
示例#3
0
 public ValidNeighbors(RulesGraph rules, LinkedListNode<string> node)
 {
     try
     {
         var ball = rules[node.Value];
         _result = ball.Balls.First(o => o.Name == node.Next.Value) != null;
     }
     catch (KeyNotFoundException)
     {
         _result = true;
     }
     catch (Exception)
     {
         _result = false;
     }
 }