void retracePath(Cell start, Cell end) { List<Cell> path = new List<Cell>(); Cell currentCell = end; while (currentCell != start) { path.Add(currentCell); currentCell = currentCell.parent; } path.Reverse(); start.paintFloor(Color.cyan); foreach (Cell cell in path) { if (!cell.isVisible) cell.paintFloor(Color.green); else if (cell.camerasWatching < cameraMaximum) cell.paintFloor(Color.yellow); else { spottedByCameras++; cell.paintFloor(Color.red); break; } } }