-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy pathProperty.cs
60 lines (50 loc) · 1.79 KB
/
Property.cs
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
namespace KBEngine
{
using UnityEngine;
using System;
/*
抽象出一个entitydef中定义的属性
该模块描述了属性的id以及数据类型等信息
*/
public class Property
{
public enum EntityDataFlags
{
ED_FLAG_UNKOWN = 0x00000000, // 未定义
ED_FLAG_CELL_PUBLIC = 0x00000001, // 相关所有cell广播
ED_FLAG_CELL_PRIVATE = 0x00000002, // 当前cell
ED_FLAG_ALL_CLIENTS = 0x00000004, // cell广播与所有客户端
ED_FLAG_CELL_PUBLIC_AND_OWN = 0x00000008, // cell广播与自己的客户端
ED_FLAG_OWN_CLIENT = 0x00000010, // 当前cell和客户端
ED_FLAG_BASE_AND_CLIENT = 0x00000020, // base和客户端
ED_FLAG_BASE = 0x00000040, // 当前base
ED_FLAG_OTHER_CLIENTS = 0x00000080, // cell广播和其他客户端
};
public string name = "";
public KBEDATATYPE_BASE utype = null;
public UInt16 properUtype = 0;
public UInt32 properFlags = 0;
public Int16 aliasID = -1;
public string defaultValStr = "";
public System.Reflection.MethodInfo setmethod = null;
public object val = null;
public Property()
{
}
public bool isBase()
{
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_BASE_AND_CLIENT ||
properFlags == (UInt32)EntityDataFlags.ED_FLAG_BASE;
}
public bool isOwnerOnly()
{
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_CELL_PUBLIC_AND_OWN ||
properFlags == (UInt32)EntityDataFlags.ED_FLAG_OWN_CLIENT;
}
public bool isOtherOnly()
{
return properFlags == (UInt32)EntityDataFlags.ED_FLAG_OTHER_CLIENTS ||
properFlags == (UInt32)EntityDataFlags.ED_FLAG_OTHER_CLIENTS;
}
}
}