Beispiel #1
0
 /// <summary>
 /// Generates a <see cref="Printer"/> instance with the specified rendered area, printable bounds and entities
 /// </summary>
 /// <param name="renderedArea">Area that is printed on the screen</param>
 /// <param name="printableBounds">Bounds of the area that can be printed</param>
 /// <param name="entities">Entities that will be printed</param>
 /// <exception cref="ArgumentNullException"/>
 public Printer(Rectangle renderedArea, Bounds2D printableBounds, IEnumerable <Entity> entities)
Beispiel #2
0
        /// <summary>
        /// Checks if a position relative to the current one is within the specified boundaries
        /// </summary>
        /// <param name="bounds">Bounds to check if they contain the relative position</param>
        /// <param name="direction">Direction in which the movement should occurr</param>
        /// <param name="amount">How many tiles should the movement cover</param>
        /// <exception cref="ArgumentNullException"/>
        /// <exception cref="UnknownEnumValueException"/>
        public bool InsideBoundsAfterMovement(Bounds2D bounds, Direction direction, int amount)
        {
            bounds.ThrowIfNull(nameof(bounds));

            return(GetRelativePosition(direction, amount).InsideBounds(bounds));
        }