Started working on a system that I think will be reused in quite a few places throughout the game. I'm having a hard time coming up with a succinct title for it, but I'm currently calling it "Tile Mask".
Basically, I want to define a reusable object that defines all the tiles that should be 'valid' for a given action, from a given position, for things like: movement, attacking, area-of-affect abilities etc. Basically, it's this from Hoplite.
In the Unity world, I'm implementing it as a Scriptable Object that will be configurable in the editor, and then reuseable on other prefabs/components so, for instance, an attack component can be 'masked' by a "Tile Mask". The "Tile Mask" exposes a simple API for checking if a queried position is 'valid'. Valid means it's within the mask'd grid cells, and (for now) also whether the tile is actually passable in the terrain.
This is what I have so far:
For now, the 'shape' of the mask is limited to a rectangle, but soon I will implement the ability to configure it to arbitrary shapes with some improved Editor scripting.
Implementing it did raise a pretty serious design question: