private void AddLowerValueTile(IList<Tile> result, Tile otherTile) { if (otherTile != null && otherTile.Elevation < Elevation) { result.Add(otherTile); } }
public void AddTile(Tile tile) { var lastTile = Tiles.LastOrDefault(); if (lastTile != null) { lastTile.East = tile; tile.West = lastTile; } tile.Step = this; Tiles.Add(tile); }
private static void TraverseDownward( ICollection<IList<int>> flattenPath, Tile currentTile, IEnumerable<int> previousPath) { var newPath = new List<int>(previousPath) {currentTile.Elevation}; flattenPath.Add(newPath); var otherTiles = currentTile.GetDownwardTiles(); foreach (var otherTile in otherTiles) { TraverseDownward(flattenPath, otherTile, newPath); } }