The named tuning knobs of a heuristic AI - Wesnoth's "aspects" - read by whatever stage is
scoring candidates. mwg ships no values, because the numbers are game content: a side sets
aggression, caution, village_value, keep_away and the rest to whatever its own balance
wants, and a difficulty level overrides a few of them.
Typed readers give a stage a usable number without every caller casting: a missing aspect reads
as the fallback the caller passes (1 for a neutral weight, 0 where an unset aspect should zero the score).
The named tuning knobs of a heuristic AI - Wesnoth's "aspects" - read by whatever stage is scoring candidates.
mwgships no values, because the numbers are game content: a side setsaggression,caution,village_value,keep_awayand the rest to whatever its own balance wants, and a difficulty level overrides a few of them.Typed readers give a stage a usable number without every caller casting: a missing aspect reads as the fallback the caller passes (
1for a neutral weight,0where an unset aspect should zero the score).Example