コード例 #1
0
 private void AddLowerValueTile(IList<Tile> result, Tile otherTile)
 {
     if (otherTile != null && otherTile.Elevation < Elevation)
     {
         result.Add(otherTile);
     }
 }
コード例 #2
0
        public void AddTile(Tile tile)
        {
            var lastTile = Tiles.LastOrDefault();

            if (lastTile != null)
            {
                lastTile.East = tile;
                tile.West = lastTile;
            }

            tile.Step = this;
            Tiles.Add(tile);
        }
コード例 #3
0
        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);
            }
        }