This repository was archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathServerClass.cs
105 lines (84 loc) · 2.5 KB
/
ServerClass.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
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
using DemoInfo.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DemoInfo.DP;
namespace DemoInfo.DT
{
class ServerClass : IDisposable
{
public int ClassID;
public int DataTableID;
public string Name;
public string DTName;
public List<FlattenedPropEntry> FlattenedProps = new List<FlattenedPropEntry>();
public List<ServerClass> BaseClasses = new List<ServerClass> ();
public event EventHandler<EntityCreatedEventArgs> OnNewEntity;
internal void AnnounceNewEntity(Entity e)
{
if(OnNewEntity != null)
OnNewEntity(this, new EntityCreatedEventArgs(this, e));
}
public event EventHandler<EntityDestroyedEventArgs> OnDestroyEntity;
internal void AnnounceDestroyedEntity(Entity e)
{
if (OnDestroyEntity != null)
OnDestroyEntity(this, new EntityDestroyedEventArgs(this, e));
}
public override string ToString()
{
return Name + " | " + DTName;
}
public void Dispose ()
{
this.OnNewEntity = null;
this.OnDestroyEntity = null;
}
}
internal class FlattenedPropEntry
{
public SendTableProperty Prop { get; private set; }
public SendTableProperty ArrayElementProp { get; private set; }
public string PropertyName { get; private set; }
public FlattenedPropEntry(string propertyName, SendTableProperty prop, SendTableProperty arrayElementProp)
{
this.Prop = prop;
this.ArrayElementProp = arrayElementProp;
this.PropertyName = propertyName;
}
public override string ToString()
{
return string.Format("[FlattenedPropEntry: PropertyName={2}, Prop={0}, ArrayElementProp={1}]", Prop, ArrayElementProp, PropertyName);
}
};
class ExcludeEntry
{
public ExcludeEntry( string varName, string dtName, string excludingDT )
{
VarName = varName;
DTName = dtName;
ExcludingDT = excludingDT;
}
public string VarName { get; private set; }
public string DTName { get; private set; }
public string ExcludingDT { get; private set; }
}
class EntityCreatedEventArgs : EventArgs
{
public ServerClass Class { get; private set; }
public Entity Entity { get; private set; }
public EntityCreatedEventArgs(ServerClass c, Entity e)
{
this.Class = c;
this.Entity = e;
}
}
class EntityDestroyedEventArgs : EntityCreatedEventArgs
{
public EntityDestroyedEventArgs(ServerClass c, Entity e) : base(c, e)
{
}
}
}