ISelectionRules
namespace Griff.Scenes;
public interface ISelectionRulesWhat a SelectionState asks of the game it selects in: what a click or a box picks, what a double-click picks, and what a Shift-click can add. A SelectionControls answers with the Selectables in view; the Strategy module’s Commander with its team’s units, buildings and resources.
Methods
Section titled “Methods”CanAdd
Section titled “CanAdd”public abstract bool CanAdd(Entity picked, IReadOnlyList<Entity> selected)Whether a click with AddToSelection held adds picked to selected (or takes it out), rather than selecting it alone.
public abstract IEnumerable<Entity> InBox(Box box)What a box dragged out over box picks.
public abstract bool Keeps(Entity entity)Whether entity, selected, stays selected as a box adds to the selection, and goes into a control group kept.
PickAt
Section titled “PickAt”public abstract Entity? PickAt(Vector2 point)What a click at point (in the world) picks, or null for nothing.
SameKind
Section titled “SameKind”public abstract IEnumerable<Entity>? SameKind(Entity picked)What a double-click on picked picks (every one of its kind on screen), or null if a double-click on it is only a click.
SelectionSet
Section titled “SelectionSet”public abstract void SelectionSet()Called each time a click, a box or a control group sets the selection, even to what it was.
StillThere
Section titled “StillThere”public abstract bool StillThere(Entity entity)Whether a control group still has entity as it’s picked again: false once it’s gone.