public Node GetOtherNode(Node node)
 {
     if (FirstNode.Equals(node))
     {
         return(SecondNode);
     }
     if (SecondNode.Equals(node))
     {
         return(FirstNode);
     }
     return(null);
 }
        public override Boolean Equals(Object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            var wall = obj as Wall;

            if (wall == null)
            {
                return(false);
            }
            return(FirstNode.Equals(wall.FirstNode) && SecondNode.Equals(wall.SecondNode) ||
                   FirstNode.Equals(wall.SecondNode) && SecondNode.Equals(wall.FirstNode));
        }
 public Boolean ContainsNode(Node node) => FirstNode.Equals(node) || SecondNode.Equals(node);