summaryrefslogtreecommitdiff
path: root/src/script/api/script_event.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-11-29 23:15:35 +0000
committertruebrain <truebrain@openttd.org>2011-11-29 23:15:35 +0000
commit98103121d4f2ed1f1581919b7b1f343ccd410c12 (patch)
tree1e760dd6517a6b0f9fb669ec277139a8e3f9a4a3 /src/script/api/script_event.cpp
parentafdb67a3534f85b4efbd3327ece8137211042d7b (diff)
downloadopenttd-98103121d4f2ed1f1581919b7b1f343ccd410c12.tar.xz
(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
Diffstat (limited to 'src/script/api/script_event.cpp')
-rw-r--r--src/script/api/script_event.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/script/api/script_event.cpp b/src/script/api/script_event.cpp
index 6fdbea02a..1237402ac 100644
--- a/src/script/api/script_event.cpp
+++ b/src/script/api/script_event.cpp
@@ -7,7 +7,7 @@
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
-/** @file script_event.cpp Implementation of AIEvent. */
+/** @file script_event.cpp Implementation of ScriptEvent. */
#include "../../stdafx.h"
#include "script_event_types.hpp"
@@ -15,24 +15,24 @@
#include <queue>
/** The queue of events for an AI. */
-struct AIEventData {
- std::queue<AIEvent *> stack; ///< The actual queue.
+struct ScriptEventData {
+ std::queue<ScriptEvent *> stack; ///< The actual queue.
};
-/* static */ void AIEventController::CreateEventPointer()
+/* static */ void ScriptEventController::CreateEventPointer()
{
- assert(AIObject::GetEventPointer() == NULL);
+ assert(ScriptObject::GetEventPointer() == NULL);
- AIObject::GetEventPointer() = new AIEventData();
+ ScriptObject::GetEventPointer() = new ScriptEventData();
}
-/* static */ void AIEventController::FreeEventPointer()
+/* static */ void ScriptEventController::FreeEventPointer()
{
- AIEventData *data = (AIEventData *)AIObject::GetEventPointer();
+ ScriptEventData *data = (ScriptEventData *)ScriptObject::GetEventPointer();
/* Free all waiting events (if any) */
while (!data->stack.empty()) {
- AIEvent *e = data->stack.front();
+ ScriptEvent *e = data->stack.front();
data->stack.pop();
e->Release();
}
@@ -41,30 +41,30 @@ struct AIEventData {
delete data;
}
-/* static */ bool AIEventController::IsEventWaiting()
+/* static */ bool ScriptEventController::IsEventWaiting()
{
- if (AIObject::GetEventPointer() == NULL) AIEventController::CreateEventPointer();
- AIEventData *data = (AIEventData *)AIObject::GetEventPointer();
+ if (ScriptObject::GetEventPointer() == NULL) ScriptEventController::CreateEventPointer();
+ ScriptEventData *data = (ScriptEventData *)ScriptObject::GetEventPointer();
return !data->stack.empty();
}
-/* static */ AIEvent *AIEventController::GetNextEvent()
+/* static */ ScriptEvent *ScriptEventController::GetNextEvent()
{
- if (AIObject::GetEventPointer() == NULL) AIEventController::CreateEventPointer();
- AIEventData *data = (AIEventData *)AIObject::GetEventPointer();
+ if (ScriptObject::GetEventPointer() == NULL) ScriptEventController::CreateEventPointer();
+ ScriptEventData *data = (ScriptEventData *)ScriptObject::GetEventPointer();
if (data->stack.empty()) return NULL;
- AIEvent *e = data->stack.front();
+ ScriptEvent *e = data->stack.front();
data->stack.pop();
return e;
}
-/* static */ void AIEventController::InsertEvent(AIEvent *event)
+/* static */ void ScriptEventController::InsertEvent(ScriptEvent *event)
{
- if (AIObject::GetEventPointer() == NULL) AIEventController::CreateEventPointer();
- AIEventData *data = (AIEventData *)AIObject::GetEventPointer();
+ if (ScriptObject::GetEventPointer() == NULL) ScriptEventController::CreateEventPointer();
+ ScriptEventData *data = (ScriptEventData *)ScriptObject::GetEventPointer();
event->AddRef();
data->stack.push(event);