1004
|
1 #include "GTaskArray.h"
|
|
2
|
|
3 GTaskArray::GTaskArray()
|
|
4 {
|
|
5 game_task_array = NULL;
|
|
6 game_task = NULL;
|
|
7
|
|
8 task_id = 0;
|
|
9 task_num = 0;
|
|
10 param_num = 0;
|
|
11 inData_num = 0;
|
|
12 outData_num = 0;
|
|
13 }
|
|
14
|
|
15 GTaskArray::~GTaskArray()
|
|
16 {
|
|
17 if (game_task_array !=NULL) {
|
|
18 delete game_task_array;
|
|
19 }
|
|
20 if (game_task !=NULL) {
|
|
21 delete game_task;
|
|
22 }
|
|
23 }
|
|
24
|
|
25 void
|
|
26 GTaskArray::init(int id, int task, int param, int inData, int outData)
|
|
27 {
|
|
28 game_task = 0;
|
|
29
|
|
30 task_id = id;
|
|
31 task_num = task;
|
|
32 param_num = param;
|
|
33 inData_num = inData;
|
|
34 outData_num = outData;
|
|
35 }
|
|
36
|
|
37 void
|
|
38 GTaskArray::create_task_array(TaskManager *manager)
|
|
39 {
|
|
40 game_task_array = manager->create_task_array(task_id, task_num, param_num, inData_num, outData_num);
|
|
41 game_task = 0;
|
|
42 }
|
|
43
|
|
44 void
|
|
45 GTaskArray::next_task_array(int id)
|
|
46 {
|
|
47 game_task = game_task_array->next_task_array(id, game_task);
|
|
48 }
|
|
49
|
|
50 void
|
|
51 GTaskArray::finish()
|
|
52 {
|
|
53 game_task_array->spawn_task_array(game_task->next());
|
|
54 game_task_array->set_cpu(SPE_ANY);
|
|
55 game_task_array->spawn();
|
|
56 }
|