Show / Hide Table of Contents

MaskModifier

Quick facts
ClassMaskModifier
CellTypeUnchanged
CellDirUnchanged
CellRotationUnchanged
BoundUnchanged
PropertiesUnchanged or set to Finite
RequirementsNone

This modifier restricts the set of cells in a grid. This operates much like bounds do, but it supports an arbitrary set of cells, a bit less efficiently. That means that TryMove, FindCell etc will fail instead of returning cells that have not been included.

There are two modes of operations. Either you supply a finite set of cells, or you supply a function which returns true for cells that need to be included.

For example, here the modifier filters a grid to just cells lying on the x or y axes.

centerSquare.Masked(cell => cell.x == 0 || cell.y == 0)

➡

This modifier can also be applied by extension methods Masked or Masked.

Cell co-ordinates

This modifier does not alter cell co-ordinates.

In This Article
Back to top Generated by DocFX