添加 SepCore.Runtime 和 SepCore.Base 程序集
- 暂时将 Entity 全部归进 Runtime 程序集里 - 调整部分 UI 的 UseCase/RawData/Context 之间的关系,让 RawData 更接近业务原始数据,Context 更接近 UI 直接可读的数据 - 调整其他程序集的引用关系
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using CustomUtility;
|
||||
using SepCore.DataTable;
|
||||
using SepCore.Definition;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -7,19 +9,46 @@ namespace SepCore.UI
|
||||
{
|
||||
public string Title;
|
||||
public ItemRarity Rarity;
|
||||
public string Type;
|
||||
public Sprite Icon;
|
||||
public ItemType ItemType;
|
||||
public string Description;
|
||||
public int Price;
|
||||
|
||||
public GoodsItemContext()
|
||||
{
|
||||
Title = string.Empty;
|
||||
Description = string.Empty;
|
||||
Rarity = ItemRarity.White;
|
||||
Price = 0;
|
||||
Icon = null;
|
||||
ItemType = ItemType.None;
|
||||
}
|
||||
|
||||
public GoodsItemContext(GoodsItemRawData rawData)
|
||||
{
|
||||
Title = rawData.Title;
|
||||
Description = rawData.Description;
|
||||
Price = rawData.Price;
|
||||
Rarity = rawData.Rarity;
|
||||
Type = rawData.Type;
|
||||
Icon = rawData.Icon;
|
||||
ItemType = rawData.ItemType;
|
||||
if (ItemType == ItemType.None)
|
||||
{
|
||||
Description = string.Empty;
|
||||
Icon = null;
|
||||
Title = string.Empty;
|
||||
}
|
||||
else if (ItemType == ItemType.Weapon)
|
||||
{
|
||||
var weapon = (DRWeapon)rawData.DataRow;
|
||||
Title = weapon.Title;
|
||||
Description = ItemDescUtility.CreateWeaponDescription(weapon);
|
||||
GameEntry.SpriteCache.GetSprite(weapon.IconAssetName, sprite => Icon = sprite);
|
||||
}
|
||||
else
|
||||
{
|
||||
var prop = (DRProp)rawData.DataRow;
|
||||
Title = prop.Title;
|
||||
Description = ItemDescUtility.CreatePropDescription(prop.Modifiers);
|
||||
GameEntry.SpriteCache.GetSprite(prop.IconAssetName, sprite => Icon = sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user