第一批重构,主要是物理迁移脚本和部分命名空间的调整
- 结构上迁移文件,将脚本分成 Base/Runtime/Presentation/Procedure/Editor 五大文件夹 - 调整 DataTable 和 Definition 下脚本的命名空间 - 依据 UI-5层架构设计规范 拆分原先的 UI 到 Runtime 和 Presentation 下
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.DataTable
|
||||
{
|
||||
/// <summary>
|
||||
/// 实体表。
|
||||
/// </summary>
|
||||
public class DREntity : DataRowBase
|
||||
{
|
||||
private int m_Id = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体编号。
|
||||
/// </summary>
|
||||
public override int Id
|
||||
{
|
||||
get { return m_Id; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取资源名称。
|
||||
/// </summary>
|
||||
public string AssetName { get; private set; }
|
||||
|
||||
public override bool ParseDataRow(string dataRowString, object userData)
|
||||
{
|
||||
string[] columnStrings = dataRowString.Split(DataTableExtension.DataSplitSeparators);
|
||||
for (int i = 0; i < columnStrings.Length; i++)
|
||||
{
|
||||
columnStrings[i] = columnStrings[i].Trim(DataTableExtension.DataTrimSeparators);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
index++;
|
||||
m_Id = int.Parse(columnStrings[index++]);
|
||||
index++;
|
||||
AssetName = columnStrings[index++];
|
||||
|
||||
GeneratePropertyArray();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool ParseDataRow(byte[] dataRowBytes, int startIndex, int length, object userData)
|
||||
{
|
||||
using (MemoryStream memoryStream = new MemoryStream(dataRowBytes, startIndex, length, false))
|
||||
{
|
||||
using (BinaryReader binaryReader = new BinaryReader(memoryStream, Encoding.UTF8))
|
||||
{
|
||||
m_Id = binaryReader.Read7BitEncodedInt32();
|
||||
AssetName = binaryReader.ReadString();
|
||||
}
|
||||
}
|
||||
|
||||
GeneratePropertyArray();
|
||||
return true;
|
||||
}
|
||||
|
||||
private void GeneratePropertyArray()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user