迁移剩下的 UI 到 Serialization 方式
This commit is contained in:
@@ -20,6 +20,7 @@ namespace SepCore.CustomComponent
|
||||
{
|
||||
"tbenemyconfig",
|
||||
"tbentityconfig",
|
||||
"tbformattext",
|
||||
"tbglobalconfig",
|
||||
"tbgoodsconfig",
|
||||
"tblevelconfig",
|
||||
@@ -57,6 +58,11 @@ namespace SepCore.CustomComponent
|
||||
StringAccessor(tables => key => tables.TbEntityConfig.GetOrDefault(key),
|
||||
tables => tables.TbEntityConfig.DataList)
|
||||
},
|
||||
{
|
||||
typeof(FormatText),
|
||||
StringAccessor(tables => key => tables.TbFormatText.GetOrDefault(key),
|
||||
tables => tables.TbFormatText.DataList)
|
||||
},
|
||||
{
|
||||
typeof(GoodsConfig),
|
||||
Accessor(tables => id => tables.TbGoodsConfig.GetOrDefault(id),
|
||||
@@ -165,7 +171,7 @@ namespace SepCore.CustomComponent
|
||||
public bool IsReady => Tables != null;
|
||||
|
||||
public TbGlobalConfig Global => Tables.TbGlobalConfig;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 按 id 获取数据行,未找到时返回 null。
|
||||
/// </summary>
|
||||
@@ -191,6 +197,7 @@ namespace SepCore.CustomComponent
|
||||
{
|
||||
return (T)accessor.StringRowGetter(Tables, id.ToString());
|
||||
}
|
||||
|
||||
throw new NotSupportedException("Table for type '" + typeof(T).FullName + "' does not use an int key.");
|
||||
}
|
||||
|
||||
@@ -222,7 +229,9 @@ namespace SepCore.CustomComponent
|
||||
{
|
||||
return (T)accessor.RowGetter(Tables, parsedId);
|
||||
}
|
||||
throw new NotSupportedException("Table for type '" + typeof(T).FullName + "' does not use a string key.");
|
||||
|
||||
throw new NotSupportedException(
|
||||
"Table for type '" + typeof(T).FullName + "' does not use a string key.");
|
||||
}
|
||||
|
||||
return (T)accessor.StringRowGetter(Tables, key);
|
||||
|
||||
Reference in New Issue
Block a user