Skip to content

Commit 8a39773

Browse files
committed
1.删除Entity冗余属性。
1 parent 07ed5d1 commit 8a39773

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

Entity.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ public class Entity
2626

2727
public bool inWorld = false;
2828

29-
public static Dictionary<string, Dictionary<string, Property>> alldefpropertys =
30-
new Dictionary<string, Dictionary<string, Property>>();
31-
3229
// entityDef属性,服务端同步过来后存储在这里
3330
private Dictionary<string, Property> defpropertys_ =
3431
new Dictionary<string, Property>();
@@ -38,12 +35,11 @@ public class Entity
3835

3936
public static void clear()
4037
{
41-
alldefpropertys.Clear();
4238
}
4339

4440
public Entity()
4541
{
46-
foreach(Property e in alldefpropertys[GetType().Name].Values)
42+
foreach(Property e in EntityDef.moduledefs[GetType().Name].propertys.Values)
4743
{
4844
Property newp = new Property();
4945
newp.name = e.name;

KBEngine.cs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -799,10 +799,7 @@ public void onImportClientEntityDef(MemoryStream stream)
799799
ScriptModule module = new ScriptModule(scriptmethod_name);
800800
EntityDef.moduledefs[scriptmethod_name] = module;
801801
EntityDef.idmoduledefs[scriptUtype] = module;
802-
803-
Dictionary<string, Property> defpropertys = new Dictionary<string, Property>();
804-
Entity.alldefpropertys.Add(scriptmethod_name, defpropertys);
805-
802+
806803
Type Class = module.script;
807804

808805
while(propertysize > 0)
@@ -964,26 +961,7 @@ public void onImportClientEntityDef(MemoryStream stream)
964961
{
965962
Dbg.ERROR_MSG("KBEngine::Client_onImportClientEntityDef: module(" + scriptmethod_name + ") not found!");
966963
}
967-
968-
foreach(string name in module.propertys.Keys)
969-
{
970-
Property infos = module.propertys[name];
971-
972-
Property newp = new Property();
973-
newp.name = infos.name;
974-
newp.properUtype = infos.properUtype;
975-
newp.aliasID = infos.aliasID;
976-
newp.utype = infos.utype;
977-
newp.val = infos.utype.parseDefaultValStr(infos.defaultValStr);
978-
newp.setmethod = infos.setmethod;
979-
980-
defpropertys.Add(infos.name, newp);
981-
if(module.script != null && module.script.GetMember(name) == null)
982-
{
983-
Dbg.ERROR_MSG(scriptmethod_name + "(" + module.script + "):: property(" + name + ") no defined!");
984-
}
985-
};
986-
964+
987965
foreach(string name in module.methods.Keys)
988966
{
989967
// Method infos = module.methods[name];

0 commit comments

Comments
 (0)