public bool PathToExit() { if (Domokun) { return(false); } if (IsExit) { return(true); } if (North != null && North.PathToExit()) { listOfSteps.Add("north"); return(true); } if (East != null && East.PathToExit()) { listOfSteps.Add("east"); return(true); } if (West != null && West.PathToExit()) { listOfSteps.Add("west"); return(true); } if (South != null && South.PathToExit()) { listOfSteps.Add("south"); return(true); } return(false); }