summaryrefslogtreecommitdiff
path: root/include/task.h
diff options
context:
space:
mode:
authorYamaArashi <YamaArashi@users.noreply.github.com>2016-10-31 08:23:51 -0700
committerGitHub <noreply@github.com>2016-10-31 08:23:51 -0700
commit343389467108cd99fb315131881b5f3f19261383 (patch)
tree4035a8314efc3149a5f818a2589c099643b08850 /include/task.h
parent6874afafe545365a52c2262da4e4a84ddf14afaf (diff)
parent4df1937738c4dc39d23f5c4e4b0d6a3774ff1b17 (diff)
Merge pull request #9 from Diegoisawesome/master
Ported task.c and others from pokeruby
Diffstat (limited to 'include/task.h')
-rw-r--r--include/task.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/task.h b/include/task.h
new file mode 100644
index 000000000..a536bcab5
--- /dev/null
+++ b/include/task.h
@@ -0,0 +1,29 @@
+#ifndef GUARD_TASK_H
+#define GUARD_TASK_H
+
+typedef void (*TaskFunc)(u8 taskId);
+
+struct Task
+{
+ TaskFunc func;
+ bool8 isActive;
+ u8 prev;
+ u8 next;
+ u8 priority;
+ s16 data[16];
+};
+
+extern struct Task gTasks[];
+
+void ResetTasks();
+u8 CreateTask(TaskFunc func, u8 priority);
+void DestroyTask(u8 taskId);
+void RunTasks();
+void TaskDummy(u8 taskId);
+void SetTaskFuncWithFollowupFunc(u8 taskId, TaskFunc func, TaskFunc followupFunc);
+void SwitchTaskToFollowupFunc(u8 taskId);
+bool8 FuncIsActiveTask(TaskFunc func);
+u8 FindTaskIdByFunc(TaskFunc func);
+u8 GetTaskCount();
+
+#endif // GUARD_TASK_H