-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTimeTask.cs
More file actions
102 lines (91 loc) · 2.19 KB
/
Copy pathTimeTask.cs
File metadata and controls
102 lines (91 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*********************************************************
文件:TimeTask
作者:Administrator
邮箱:630276388@qq.com
日期:2020/8/23 14:36:34
功能:定时任务数据类
***********************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
namespace BJTimer
{
public struct TimeTask
{
public int id;
public double delay;
public double destTime;
public Action<int> callBack;
public int count;
}
public struct FrameTask
{
public int id;
public int curFrame;
public int delay;
//public int destFrame;
public Action<int> callBack;
public int count;
}
public struct TaskFlag
{
public int id;
public int index;
public TaskType type;
public bool active;
public TaskFlag(int id, int index , TaskType type, bool active)
{
this.id = id;
this.index = index;
this.active = active;
this.type = type;
}
public TaskFlag(TaskFlag flag, bool active)
{
id = flag.id;
index = flag.index;
type = flag.type;
this.active = active;
}
public TaskFlag(TaskFlag flag, TaskType type)
{
id = flag.id;
index = flag.index;
this.type = type;
active = flag.active;
}
}
public struct TaskPack
{
public int id;
public Action<int> callBack;
public TaskPack(int _id, Action<int> _callBack)
{
id = _id;
callBack = _callBack;
}
}
public struct IDPack
{
public int id;
public TaskType type;
public IDPack(int id, TaskType type)
{
this.id = id;
this.type = type;
}
}
public enum TimeUnit
{
Millisecound,
Secound,
Minute,
Hour,
Day
}
public enum TaskType
{
TimeTask,
FrameTask
}
}