(svn r12229) [NoAI] -Fix: AISetting()s functions can be static too noai
authortruebrain
Sat, 23 Feb 2008 18:01:05 +0000
branchnoai
changeset 9749 ee414c031e73
parent 9748 4584f8cd00e8
child 9750 71106199d143
(svn r12229) [NoAI] -Fix: AISetting()s functions can be static too
bin/ai/regression/regression.nut
src/ai/api/ai_settings.cpp
src/ai/api/ai_settings.hpp
src/ai/api/ai_settings.hpp.sq
--- a/bin/ai/regression/regression.nut	Sat Feb 23 17:43:16 2008 +0000
+++ b/bin/ai/regression/regression.nut	Sat Feb 23 18:01:05 2008 +0000
@@ -11,14 +11,12 @@
 
 function Regression::TestInit()
 {
-	local settings = AISettings();
-
 	print("");
 	print("--TestInit--");
 	print(" TickTest: " + this.GetTick());
 	this.Sleep(1);
 	print(" TickTest: " + this.GetTick());
-	print(" SetCommandDelay: " + settings.SetCommandDelay(1));
+	print(" SetCommandDelay: " + AISettings.SetCommandDelay(1));
 }
 
 function Regression::Std()
--- a/src/ai/api/ai_settings.cpp	Sat Feb 23 17:43:16 2008 +0000
+++ b/src/ai/api/ai_settings.cpp	Sat Feb 23 18:01:05 2008 +0000
@@ -4,8 +4,8 @@
 
 #include "ai_settings.hpp"
 
-void AISettings::SetCommandDelay(uint ticks)
+/* static */ void AISettings::SetCommandDelay(uint ticks)
 {
 	if (ticks == 0) return;
-	this->SetDoCommandDelay(ticks);
+	AIObject::SetDoCommandDelay(ticks);
 }
--- a/src/ai/api/ai_settings.hpp	Sat Feb 23 17:43:16 2008 +0000
+++ b/src/ai/api/ai_settings.hpp	Sat Feb 23 18:01:05 2008 +0000
@@ -27,7 +27,7 @@
 	 * @pre ticks should be positive. Too big values will influence performance of the AI.
 	 * @note If the number is lower then the MP setting, the MP setting wins.
 	 */
-	void SetCommandDelay(uint ticks);
+	static void SetCommandDelay(uint ticks);
 };
 
 #endif /* AI_SETTINGS_HPP */
--- a/src/ai/api/ai_settings.hpp.sq	Sat Feb 23 17:43:16 2008 +0000
+++ b/src/ai/api/ai_settings.hpp.sq	Sat Feb 23 18:01:05 2008 +0000
@@ -14,9 +14,8 @@
 	SQAISettings.PreRegister(engine);
 	SQAISettings.AddConstructor<void (AISettings::*)(), 1>(engine, "x");
 
-	SQAISettings.DefSQStaticMethod(engine, &AISettings::GetClassName, "GetClassName", 1, "x");
-
-	SQAISettings.DefSQMethod(engine, &AISettings::SetCommandDelay, "SetCommandDelay", 2, "xi");
+	SQAISettings.DefSQStaticMethod(engine, &AISettings::GetClassName,    "GetClassName",    1, "x");
+	SQAISettings.DefSQStaticMethod(engine, &AISettings::SetCommandDelay, "SetCommandDelay", 2, "xi");
 
 	SQAISettings.PostRegister(engine);
 }