-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel
More file actions
411 lines (396 loc) · 13.1 KB
/
kernel
File metadata and controls
411 lines (396 loc) · 13.1 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
namespace kernel
public enum TaskState
Unstart
Running
Completed
Exceptional
Aborted
Invalid
public struct bool
public string ToString()
public struct byte
public string ToString()
public struct char
public string ToString()
public struct integer
public string ToString()
public struct real
public string ToString()
public struct real2
real x
real y
public real2 Normalized()
public real Magnitude()
public real SqrMagnitude()
public struct real3
real x
real y
real z
public real3 Normalized()
public real Magnitude()
public real SqrMagnitude()
public struct real4
real x
real y
real z
real w
public real4 Normalized()
public real Magnitude()
public real SqrMagnitude()
public struct enum
public string ToString() Declaration //函数名后的Declaration是编译器添加的参数,对用户透明
public struct type
public bool IsPublic()
public string[] GetAttributes()
public string GetName()
public type GetParent()
public type[] GetInherits()
public Reflection.MemberConstructor[] GetConstructors() //只返回当前类型中定义的构造函数
public Reflection.MemberVariable[] GetVariables() //只返回当前类型中定义的字段
public Reflection.MemberFunction[] GetFunctions() //只返回当前类型中定义的函数
public Reflection.Space GetSpace()
public Reflection.TypeCode GetTypeCode()
public bool IsAssignable(type) //判断当前类型的对象是否可赋值给目标类型的变量
public bool IsValid()
public integer[] GetEnumElements()
public string[] GetEnumElementNames()
public type[] GetParameters() //委托的参数类型列表
public type[] GetReturns() //委托或任务的返回值类型列表
public handle CreateUninitialized() //创建该类型的未初始化对象
public Delegate CreateDelegate(Reflection.Function) //创建全局函数的委托对象,返回当前类型的委托对象
public Delegate CreateDelegate(Reflection.Native) //创建本地函数的委托对象,返回当前类型的委托对象
public Delegate CreateDelegate(Reflection.MemberFunction, handle target, bool realCall) //创建成员函数的委托对象,返回当前类型的委托对象
public Task CreateTask(Reflection.Function function, handle[] parameters) //创建一个任务,返回当前类型的任务对象
public Task CreateTask(Reflection.MemberFunction function, handle target, handle[] parameters, bool realCall) //创建一个任务,返回当前类型的任务对象
public array CreateArray(integer legnth)
public integer GetArrayRank()
public type GetArrayElementType()
public struct string
public integer GetLength()
public integer GetStringID()
public bool ToBool()
public integer ToInteger()
public real ToReal()
public char[] ToChars()
public struct entity
public integer GetEntityID()
public class handle
public string ToString()
public integer GetHandleID()
public type GetType()
public class Delegate handle
public handle[] Invoke(handle[] parameters)
public class Task handle
public Start(bool immediately, bool ignoreWait)
public Abort()
public SetName(string name)
public string GetName()
public integer GetInstantID()
public TaskState GetState()
public string GetExitCode()
public bool IsPause()
public Pause()
public Resume()
public handle[] GetResults()
public class array handle Collections.Enumerable
public integer GetLength()
public handle GetElement(integer index)
public SetElement(integer index, handle element)
public Collections.Enumerator GetEnumerator()
public bool < (integer, integer)
public bool < (real, real)
public bool <= (integer, integer)
public bool <= (real, real)
public bool > (integer, integer)
public bool > (real, real)
public bool >= (integer, integer)
public bool >= (real, real)
public bool == (bool, bool)
public bool == (integer, integer)
public bool == (real, real)
public bool == (real2, real2)
public bool == (real3, real3)
public bool == (real4, real4)
public bool == (string, string)
public bool == (handle, handle)
public bool == (entity, entity)
public bool == (Delegate, Delegate)
public bool == (type, type)
public bool == (Reflection.Variable, Reflection.Variable)
public bool == (Reflection.MemberConstructor, Reflection.MemberConstructor)
public bool == (Reflection.MemberVariable, Reflection.MemberVariable)
public bool == (Reflection.MemberFunction, Reflection.MemberFunction)
public bool == (Reflection.Function, Reflection.Function)
public bool == (Reflection.Native, Reflection.Native)
public bool != (bool, bool)
public bool != (integer, integer)
public bool != (real, real)
public bool != (real2, real2)
public bool != (real3, real3)
public bool != (real4, real4)
public bool != (string, string)
public bool != (handle, handle)
public bool != (entity, entity)
public bool != (Delegate, Delegate)
public bool != (type, type)
public bool != (Reflection.Variable, Reflection.Variable)
public bool != (Reflection.MemberConstructor, Reflection.MemberConstructor)
public bool != (Reflection.MemberVariable, Reflection.MemberVariable)
public bool != (Reflection.MemberFunction, Reflection.MemberFunction)
public bool != (Reflection.Function, Reflection.Function)
public bool != (Reflection.Native, Reflection.Native)
public bool & (bool, bool)
public integer & (integer, integer)
public bool | (bool, bool)
public integer | (integer, integer)
public bool ^ (bool, bool)
public integer ^ (integer, integer)
public integer << (integer, integer)
public integer >> (integer, integer)
public integer + (integer, integer)
public real + (real, real)
public real2 + (real2, real2)
public real3 + (real3, real3)
public real4 + (real4, real4)
public string + (string, string)
public string + (string, bool)
public string + (string, char)
public string + (string, integer)
public string + (string, real)
public string + (string, handle)
public string + (bool, string)
public string + (char, string)
public string + (integer, string)
public string + (real, string)
public string + (handle, string)
public integer - (integer, integer)
public real - (real, real)
public real2 - (real2, real2)
public real3 - (real3, real3)
public real4 - (real4, real4)
public integer * (integer, integer)
public real * (real, real)
public real2 * (real2, real)
public real3 * (real3, real)
public real4 * (real4, real)
public real2 * (real, real2)
public real3 * (real, real3)
public real4 * (real, real4)
public real2 * (real2, real2)
public real3 * (real3, real3)
public real4 * (real4, real4)
public integer / (integer, integer)
public real / (real, real)
public real2 / (real2, real)
public real3 / (real3, real)
public real4 / (real4, real)
public real2 / (real, real2)
public real3 / (real, real3)
public real4 / (real, real4)
public real2 / (real2, real2)
public real3 / (real3, real3)
public real4 / (real4, real4)
public integer % (integer, integer)
public bool ! (bool)
public bool ~ (bool)
public integer ~ (integer)
public integer + (integer)
public real + (real)
public real2 + (real2)
public real3 + (real3)
public real4 + (real4)
public integer - (integer)
public real - (real)
public real2 - (real2)
public real3 - (real3)
public real4 - (real4)
public integer ++ (integer) //反射调用该函数无效果,这里只是个声明
public integer ++ (real) //反射调用该函数无效果,这里只是个声明
public integer -- (integer) //反射调用该函数无效果,这里只是个声明
public integer -- (real) //反射调用该函数无效果,这里只是个声明
namespace BitConvert
public integer BytesConvertInteger(byte, byte, byte, byte, byte, byte, byte, byte)
public real BytesConvertReal(byte, byte, byte, byte, byte, byte, byte, byte)
public string BytesConvertString(byte[])
public byte, byte, byte, byte, byte, byte, byte, byte IntegerConvertBytes(integer)
public byte, byte, byte, byte, byte, byte, byte, byte RealConvertBytes(real)
public byte[] StringConvertBytes(string)
namespace Math
public const real PI
public const real E
public const real Rad2Deg
public const real Deg2Rad
public integer Abs(integer)
public integer Clamp(integer, integer, integer)
public integer GetRandomInt() //[-max, max]
public integer Max(integer, integer)
public integer Min(integer, integer)
public real Abs(real)
public real Acos(real)
public real Asin(real)
public real Atan(real)
public real Atan2(real, real)
public integer Ceil(real)
public real Clamp(real, real, real)
public real Clamp01(real)
public real Cos(real)
public integer Floor(real)
public real GetRandomReal() //[0, 1)
public real Lerp(real, real, real)
public real Max(real, real)
public real Min(real, real)
public integer Round(real)
public integer Sign(real)
public real Sin(real)
public real, real SinCos(real)
public real Sqrt(real)
public real Tan(real)
public real Angle(real2, real2)
public real Cross(real2, real2)
public real Dot(real2, real2)
public real2 Lerp(real2, real2, real)
public real2 Max(real2, real2)
public real2 Min(real2, real2)
public real Angle(real3, real3)
public real3 Cross(real3, real3)
public real Dot(real3, real3)
public real3 Lerp(real3, real3, real)
public real3 Max(real3, real3)
public real3 Min(real3, real3)
public real Angle(real4, real4)
public real Dot(real4, real4)
public real4 Lerp(real4, real4, real)
public real4 Max(real4, real4)
public real4 Min(real4, real4)
namespace System
namespace Exceptions
public const string NullReference
public const string InvalidTask
public const string OutOfRange
public const string InvalidType
public const string NotEnum
public const string NotArray
public const string NotDelegate
public const string NotTask
public const string NotDelegateOrTask
public const string CantCreateOfThisType
public const string TaskNotUnstart
public const string TaskNotRunning
public const string TaskNotCompleted
public const string DivideByZero
public const string InvalidCast
public const string StackOverflow
public const string AssignmentReadonlyVariable
public const string ParameterListDoesNotMatch
public const string ReturnListDoesNotMatch
public const string IgnoreWaitButConditionNotValid
public const string IgnoreWaitButTaskNotCompleted
public const string AllocHeapMemoryOnGC
public const string HeapOverflow
public const string InvalidOperation
public const string InvalidReflection
public integer Collect(bool)
public integer HeapTotalMemory()
public integer CountHandle()
public integer CountTask()
public integer EntityCount()
public integer StringCount()
public SetRandomSeed(integer)
public Reflection.Assembly[] GetAssembles()
public integer GetCurrentTaskInstantID()
public string CreateString(char[], integer startIndex, integer count)
namespace Collections
public interface Enumerable
Enumerator GetEnumerator()
public interface Enumerator
bool, handle Next()
public class ArrayEnumerator Enumerator
private handle source
private integer index
public bool, handle Next()
namespace Reflection
public enum TypeCode
Invalid
Struct
Bool
Byte
Char
Integer
Real
Real2
Real3
Real4
Enum
Type
String
Entity
Handle
Interface
Delegate
Task
Array
public struct Variable
bool readonly
bool isPublic
Space owningSpace
string name
type variableType
public bool IsValid()
public string[] GetAttributes()
public handle GetValue()
public SetValue(handle)
public struct MemberConstructor
bool isPublic
type declaringType
public bool IsValid()
public string[] GetAttributes()
public type[] GetParameters()
public handle Invoke(handle[])
public struct MemberVariable
bool readonly
bool isPublic
type declaringType
string name
type variableType
public bool IsValid()
public string[] GetAttributes()
public handle GetValue(handle)
public SetValue(handle, handle)
public struct MemberFunction
bool isPublic
type declaringType
string name
public bool IsValid()
public string[] GetAttributes()
public type[] GetParameters()
public type[] GetReturns()
public handle[] Invoke(handle, handle[], bool realCall)
public struct Function
bool isPublic
Space owningSpace
string name
public bool IsValid()
public string[] GetAttributes()
public type[] GetParameters()
public type[] GetReturns()
public handle[] Invoke(handle[])
public struct Native
bool isPublic
Space owningSpace
string name
public bool IsValid()
public string[] GetAttributes()
public type[] GetParameters()
public type[] GetReturns()
public handle[] Invoke(handle[])
public class Space
public string[] GetAttributes()
public Space GetParent()
public Space[] GetChildren()
public Assembly GetAssembly()
public string GetName()
public Variable[] GetVariables()
public Function[] GetFunctions()
public Native[] GetNatives()
public type[] GetTypes()
public class Assembly Space