static */
| 30 | template <> SQInteger PushClassName<AIInfo, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AIInfo"); return 1; } |
| 31 | |
| 32 | /* static */ void AIInfo::RegisterAPI(Squirrel &engine) |
| 33 | { |
| 34 | /* Create the AIInfo class, and add the RegisterAI function */ |
| 35 | DefSQClass<AIInfo, ScriptType::AI> SQAIInfo("AIInfo"); |
| 36 | SQAIInfo.PreRegister(engine); |
| 37 | SQAIInfo.AddConstructor<void (AIInfo::*)()>(engine, "x"); |
| 38 | SQAIInfo.DefSQAdvancedMethod(engine, &AIInfo::AddSetting, "AddSetting"); |
| 39 | SQAIInfo.DefSQAdvancedMethod(engine, &AIInfo::AddLabels, "AddLabels"); |
| 40 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{}.base(), "CONFIG_NONE"); |
| 41 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{}.base(), "CONFIG_RANDOM"); // Deprecated, mapped to NONE. |
| 42 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::Boolean}.base(), "CONFIG_BOOLEAN"); |
| 43 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::InGame}.base(), "CONFIG_INGAME"); |
| 44 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::Developer}.base(), "CONFIG_DEVELOPER"); |
| 45 | |
| 46 | /* Pre 1.2 had an AI prefix */ |
| 47 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{}.base(), "AICONFIG_NONE"); |
| 48 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{}.base(), "AICONFIG_RANDOM"); // Deprecated, mapped to NONE. |
| 49 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::Boolean}.base(), "AICONFIG_BOOLEAN"); |
| 50 | SQAIInfo.DefSQConst(engine, ScriptConfigFlags{ScriptConfigFlag::InGame}.base(), "AICONFIG_INGAME"); |
| 51 | |
| 52 | SQAIInfo.PostRegister(engine); |
| 53 | engine.AddMethod("RegisterAI", &AIInfo::Constructor, "tx"); |
| 54 | engine.AddMethod("RegisterDummyAI", &AIInfo::DummyConstructor, "tx"); |
| 55 | } |
| 56 | |
| 57 | /* static */ SQInteger AIInfo::Constructor(HSQUIRRELVM vm) |
| 58 | { |
nothing calls this directly
no test coverage detected