diff options
author | truebrain <truebrain@openttd.org> | 2011-11-29 23:15:35 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-29 23:15:35 +0000 |
commit | 98103121d4f2ed1f1581919b7b1f343ccd410c12 (patch) | |
tree | 1e760dd6517a6b0f9fb669ec277139a8e3f9a4a3 /src/ai/api/ai_company.hpp.sq | |
parent | afdb67a3534f85b4efbd3327ece8137211042d7b (diff) | |
download | openttd-98103121d4f2ed1f1581919b7b1f343ccd410c12.tar.xz |
(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
Diffstat (limited to 'src/ai/api/ai_company.hpp.sq')
-rw-r--r-- | src/ai/api/ai_company.hpp.sq | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/ai/api/ai_company.hpp.sq b/src/ai/api/ai_company.hpp.sq index 097081198..ffc1fc7bb 100644 --- a/src/ai/api/ai_company.hpp.sq +++ b/src/ai/api/ai_company.hpp.sq @@ -13,66 +13,66 @@ namespace SQConvert { /* Allow enums to be used as Squirrel parameters */ - template <> inline AICompany::Quarter GetParam(ForceType<AICompany::Quarter>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::Quarter)tmp; } - template <> inline int Return<AICompany::Quarter>(HSQUIRRELVM vm, AICompany::Quarter res) { sq_pushinteger(vm, (int32)res); return 1; } - template <> inline AICompany::CompanyID GetParam(ForceType<AICompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyID)tmp; } - template <> inline int Return<AICompany::CompanyID>(HSQUIRRELVM vm, AICompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; } - template <> inline AICompany::Gender GetParam(ForceType<AICompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::Gender)tmp; } - template <> inline int Return<AICompany::Gender>(HSQUIRRELVM vm, AICompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptCompany::Quarter GetParam(ForceType<ScriptCompany::Quarter>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Quarter)tmp; } + template <> inline int Return<ScriptCompany::Quarter>(HSQUIRRELVM vm, ScriptCompany::Quarter res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptCompany::CompanyID GetParam(ForceType<ScriptCompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::CompanyID)tmp; } + template <> inline int Return<ScriptCompany::CompanyID>(HSQUIRRELVM vm, ScriptCompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptCompany::Gender GetParam(ForceType<ScriptCompany::Gender>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Gender)tmp; } + template <> inline int Return<ScriptCompany::Gender>(HSQUIRRELVM vm, ScriptCompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; } - /* Allow AICompany to be used as Squirrel parameter */ - template <> inline AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; } - template <> inline AICompany &GetParam(ForceType<AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; } - template <> inline const AICompany *GetParam(ForceType<const AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; } - template <> inline const AICompany &GetParam(ForceType<const AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; } - template <> inline int Return<AICompany *>(HSQUIRRELVM vm, AICompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Company", res, NULL, DefSQDestructorCallback<AICompany>, true); return 1; } + /* Allow ScriptCompany to be used as Squirrel parameter */ + template <> inline ScriptCompany *GetParam(ForceType<ScriptCompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptCompany *)instance; } + template <> inline ScriptCompany &GetParam(ForceType<ScriptCompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; } + template <> inline const ScriptCompany *GetParam(ForceType<const ScriptCompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptCompany *)instance; } + template <> inline const ScriptCompany &GetParam(ForceType<const ScriptCompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; } + template <> inline int Return<ScriptCompany *>(HSQUIRRELVM vm, ScriptCompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Company", res, NULL, DefSQDestructorCallback<ScriptCompany>, true); return 1; } } // namespace SQConvert -template <> const char *GetClassName<AICompany, ST_AI>() { return "AICompany"; } +template <> const char *GetClassName<ScriptCompany, ST_AI>() { return "AICompany"; } void SQAICompany_Register(Squirrel *engine) { - DefSQClass<AICompany, ST_AI> SQAICompany("AICompany"); + DefSQClass<ScriptCompany, ST_AI> SQAICompany("AICompany"); SQAICompany.PreRegister(engine); - SQAICompany.AddConstructor<void (AICompany::*)(), 1>(engine, "x"); + SQAICompany.AddConstructor<void (ScriptCompany::*)(), 1>(engine, "x"); - SQAICompany.DefSQConst(engine, AICompany::CURRENT_QUARTER, "CURRENT_QUARTER"); - SQAICompany.DefSQConst(engine, AICompany::EARLIEST_QUARTER, "EARLIEST_QUARTER"); - SQAICompany.DefSQConst(engine, AICompany::COMPANY_FIRST, "COMPANY_FIRST"); - SQAICompany.DefSQConst(engine, AICompany::COMPANY_LAST, "COMPANY_LAST"); - SQAICompany.DefSQConst(engine, AICompany::COMPANY_SELF, "COMPANY_SELF"); - SQAICompany.DefSQConst(engine, AICompany::COMPANY_INVALID, "COMPANY_INVALID"); - SQAICompany.DefSQConst(engine, AICompany::GENDER_MALE, "GENDER_MALE"); - SQAICompany.DefSQConst(engine, AICompany::GENDER_FEMALE, "GENDER_FEMALE"); - SQAICompany.DefSQConst(engine, AICompany::GENDER_INVALID, "GENDER_INVALID"); + SQAICompany.DefSQConst(engine, ScriptCompany::CURRENT_QUARTER, "CURRENT_QUARTER"); + SQAICompany.DefSQConst(engine, ScriptCompany::EARLIEST_QUARTER, "EARLIEST_QUARTER"); + SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_FIRST, "COMPANY_FIRST"); + SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_LAST, "COMPANY_LAST"); + SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_SELF, "COMPANY_SELF"); + SQAICompany.DefSQConst(engine, ScriptCompany::COMPANY_INVALID, "COMPANY_INVALID"); + SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_MALE, "GENDER_MALE"); + SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_FEMALE, "GENDER_FEMALE"); + SQAICompany.DefSQConst(engine, ScriptCompany::GENDER_INVALID, "GENDER_INVALID"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::IsMine, "IsMine", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetName, "SetName", 2, ".."); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetName, "GetName", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentName, "SetPresidentName", 2, ".."); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentName, "GetPresidentName", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentGender, "SetPresidentGender", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentGender, "GetPresidentGender", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetLoanAmount, "SetLoanAmount", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanAmount, "GetLoanAmount", 1, "."); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetMaxLoanAmount, "GetMaxLoanAmount", 1, "."); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanInterval, "GetLoanInterval", 1, "."); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetBankBalance, "GetBankBalance", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyIncome, "GetQuarterlyIncome", 3, ".ii"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyExpenses, "GetQuarterlyExpenses", 3, ".ii"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyCargoDelivered, "GetQuarterlyCargoDelivered", 3, ".ii"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyPerformanceRating, "GetQuarterlyPerformanceRating", 3, ".ii"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetQuarterlyCompanyValue, "GetQuarterlyCompanyValue", 3, ".ii"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::BuildCompanyHQ, "BuildCompanyHQ", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetCompanyHQ, "GetCompanyHQ", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewStatus, "SetAutoRenewStatus", 2, ".b"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewStatus, "GetAutoRenewStatus", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMonths, "SetAutoRenewMonths", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMonths, "GetAutoRenewMonths", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMoney, "SetAutoRenewMoney", 2, ".i"); - SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMoney, "GetAutoRenewMoney", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::ResolveCompanyID, "ResolveCompanyID", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::IsMine, "IsMine", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetName, "SetName", 2, ".."); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetName, "GetName", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetPresidentName, "SetPresidentName", 2, ".."); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentName, "GetPresidentName", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetPresidentGender, "SetPresidentGender", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetPresidentGender, "GetPresidentGender", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetLoanAmount, "SetLoanAmount", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanAmount, "GetLoanAmount", 1, "."); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetMaxLoanAmount, "GetMaxLoanAmount", 1, "."); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetLoanInterval, "GetLoanInterval", 1, "."); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetBankBalance, "GetBankBalance", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyIncome, "GetQuarterlyIncome", 3, ".ii"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyExpenses, "GetQuarterlyExpenses", 3, ".ii"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCargoDelivered, "GetQuarterlyCargoDelivered", 3, ".ii"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyPerformanceRating, "GetQuarterlyPerformanceRating", 3, ".ii"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetQuarterlyCompanyValue, "GetQuarterlyCompanyValue", 3, ".ii"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::BuildCompanyHQ, "BuildCompanyHQ", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetCompanyHQ, "GetCompanyHQ", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewStatus, "SetAutoRenewStatus", 2, ".b"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewStatus, "GetAutoRenewStatus", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewMonths, "SetAutoRenewMonths", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewMonths, "GetAutoRenewMonths", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::SetAutoRenewMoney, "SetAutoRenewMoney", 2, ".i"); + SQAICompany.DefSQStaticMethod(engine, &ScriptCompany::GetAutoRenewMoney, "GetAutoRenewMoney", 2, ".i"); SQAICompany.PostRegister(engine); } |