예제 #1
0
        /// <summary>
        /// Returns a value indicating whether <paramref name="region"/> can be translated by the specified
        /// <paramref name="offset"/>.
        /// </summary>
        /// <param name="region">
        /// The region to check.
        /// </param>
        /// <param name="offset">
        /// The offset to check.
        /// </param>
        /// <returns>
        /// <see langword="true"/> if <paramref name="region"/> can be translated by the specified
        /// <paramref name="offset"/>; otherwise, <see langword="false"/>.
        /// </returns>
        public static bool CanTranslateBy(this IMoveOnlyRegion region, Coord offset)
        {
            if (region is null)
            {
                throw new ArgumentNullException(nameof(region));
            }

            return(region.CanMoveTo(region.TopLeft + offset));
        }