The order a side recruits in - Wesnoth's recruitment_pattern, e.g. scout, fighter, archer - cycled by turn. A side with nothing left to recruit falls back to its fallback, and a side with neither recruits nothing.
recruitment_pattern
scout, fighter, archer
fallback
import { RecruitmentPattern } from '@datamoc/mw_games/ai';const pattern = new RecruitmentPattern(['scout', 'fighter'], 'fighter');console.log(pattern.at(0), pattern.at(1), pattern.at(2)); // scout fighter scout Copy
import { RecruitmentPattern } from '@datamoc/mw_games/ai';const pattern = new RecruitmentPattern(['scout', 'fighter'], 'fighter');console.log(pattern.at(0), pattern.at(1), pattern.at(2)); // scout fighter scout
the unit type at a position in the cycle, or the fallback when the pattern is empty
the entry after after in the cycle, or the first when after is not in it
after
The order a side recruits in - Wesnoth's
recruitment_pattern, e.g.scout, fighter, archer- cycled by turn. A side with nothing left to recruit falls back to itsfallback, and a side with neither recruits nothing.Example