the units that may be picked as the attacker
both steps are done, so the caller has an attack to make
the index of the highlight within the active list
the units the chosen attacker may hit; empty until an attacker is chosen
undoes the attacker choice, so a wrong attacker can be picked again
moves the highlight, wrapping at both ends, within whichever list is active
takes the highlighted unit: on the attacker stage it advances to choosing a target
The two-step unit selector an attack starts with: pick who attacks, then pick what they attack.
Renderer-free, so the choosing rules are tested without a board:
candidatesare the enabled units on the selecting side,targetsare the enabled units that passcanTargetonce an attacker is chosen,movewalks the active list andselectadvances a stage.backundoes the attacker choice rather than only the target, so a player who picked the wrong attacker lands where they can pick again rather than being stuck one step in.Example