mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-20 00:37:52 +00:00

I had not realized that TextWrangler changes spaces to tabs when shifting blocks of text to the left, which had been done for all CA files when converting the engine files.
23 lines
821 B
Lua
23 lines
821 B
Lua
local AH = wesnoth.require("ai/lua/ai_helper.lua")
|
|
|
|
local ca_recruit_rushers = {}
|
|
|
|
local internal_recruit_cas = {}
|
|
local internal_params = {}
|
|
-- The following external engine creates the CA functions recruit_rushers_eval and recruit_rushers_exec
|
|
-- It also exposes find_best_recruit and find_best_recruit_hex for use by other recruit engines
|
|
|
|
-- 'ai' is nil here (not defined), so we pass it directly in the execution function below
|
|
wesnoth.require("ai/lua/generic_recruit_engine.lua").init(ai, internal_recruit_cas, internal_params)
|
|
|
|
function ca_recruit_rushers:evaluation(ai, cfg)
|
|
internal_params.randomness = cfg.randomness
|
|
return internal_recruit_cas:recruit_rushers_eval()
|
|
end
|
|
|
|
function ca_recruit_rushers:execution(ai)
|
|
return internal_recruit_cas:recruit_rushers_exec(ai)
|
|
end
|
|
|
|
return ca_recruit_rushers
|