添加 ShopForm 下的 StatForm,展示玩家属性
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using SepCore.Definition;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class StatRawData
|
||||
{
|
||||
public Dictionary<StatType, float> Values { get; } = new Dictionary<StatType, float>();
|
||||
|
||||
public float this[StatType statType]
|
||||
{
|
||||
get => GetValue(statType);
|
||||
set => SetValue(statType, value);
|
||||
}
|
||||
|
||||
public float GetValue(StatType statType)
|
||||
{
|
||||
return Values.TryGetValue(statType, out float val) ? val : 0f;
|
||||
}
|
||||
|
||||
public void SetValue(StatType statType, float value)
|
||||
{
|
||||
Values[statType] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user