예제 #1
0
        /// <summary>
        /// Marks the given tile as not being a valid choice at a given location.
        /// Then it propagates that information to other nearby tiles.
        /// </summary>
        /// <returns>The current <see cref="Status"/></returns>
        public Resolution Ban(int x, int y, int z, Tile tile)
        {
            TileCoordToPatternCoord(x, y, z, out var px, out var py, out var pz, out var o);
            var patterns = tileModelMapping.GetPatterns(tile, o);

            foreach (var p in patterns)
            {
                var status = wavePropagator.Ban(px, py, pz, p);
                if (status != Resolution.Undecided)
                {
                    return(status);
                }
            }
            return(Resolution.Undecided);
        }
예제 #2
0
        /// <summary>
        /// Marks the given tile as not being a valid choice at a given location.
        /// Then it propogates that information to other nearby tiles.
        /// </summary>
        /// <returns>The current <see cref="Status"/></returns>
        public Resolution Ban(int x, int y, int z, Tile tile)
        {
            TileCoordToPatternCoord(x, y, z, out var px, out var py, out var pz, out var ox, out var oy, out var oz);
            var patterns = GetPatterns(tilesToPatternsByOffset[CombineOffsets(ox, oy, oz)], tile);

            foreach (var p in patterns)
            {
                var status = wavePropagator.Ban(px, py, pz, p);
                if (status != Resolution.Undecided)
                {
                    return(status);
                }
            }
            return(Resolution.Undecided);
        }