Example #1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="MaskedExtent" /> class with the specified extent and mask.
 /// </summary>
 /// <param name="extent">The extent to wrap, which must not be <c>null</c>.</param>
 /// <param name="mask">The mask to use, which must not be <c>null</c>.</param>
 /// <exception cref="ArgumentNullException"><paramref name="mask" /> is <c>null</c>.</exception>
 public MaskedExtent([NotNull] Extent extent, [NotNull] Mask mask) : base(extent)
 {
     _mask = mask ?? throw new ArgumentNullException(nameof(mask));
 }
Example #2
0
 /// <inheritdoc />
 public override bool SetTile(Vector position, Tile tile) =>
 _mask.Test(Extent, position) && Extent.SetTile(position, tile);
Example #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LimitedExtent" /> class with the specified extent and limit.
 /// </summary>
 /// <param name="extent">The extent to wrap, which must not be <c>null</c>.</param>
 /// <param name="limit">The limit on the number of tiles that can be set. A negative value indicates no limit.</param>
 public LimitedExtent([NotNull] Extent extent, int limit) : base(extent)
 {
     _limit = limit;
 }