1
This commit is contained in:
@@ -94,6 +94,11 @@ namespace BITKit
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
int Value => 10;
|
||||
/// <summary>
|
||||
/// 创建运行时物品
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IRuntimeItem CreateRuntimeItem();
|
||||
}
|
||||
|
||||
public interface IRuntimeItem : ICloneable
|
||||
@@ -101,7 +106,7 @@ namespace BITKit
|
||||
/// <summary>
|
||||
/// 运行时Id
|
||||
/// </summary>
|
||||
public int Id { get; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 配置Id
|
||||
@@ -133,14 +138,23 @@ namespace BITKit
|
||||
/// 被托管的物品
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public record RuntimeItem : IRuntimeItem
|
||||
public struct RuntimeItem : IRuntimeItem
|
||||
{
|
||||
public int Id { get; set; } = new Random().Next();
|
||||
public static RuntimeItem Create()
|
||||
{
|
||||
var item = new RuntimeItem()
|
||||
{
|
||||
Id = new Random().Next(),
|
||||
RuntimeProperties =
|
||||
new Dictionary<Type, IScriptableItemProperty>()
|
||||
};
|
||||
return item;
|
||||
}
|
||||
public int Id { get; set; }
|
||||
public int ScriptableId { get; set; }
|
||||
public int Amount { get; set; }
|
||||
|
||||
public IDictionary<Type, IScriptableItemProperty> RuntimeProperties { get; set; } =
|
||||
new Dictionary<Type, IScriptableItemProperty>();
|
||||
public IDictionary<Type, IScriptableItemProperty> RuntimeProperties { get; set; }
|
||||
|
||||
public event Action<IRuntimeItem> OnRuntimePropertiesChanged;
|
||||
|
||||
|
Reference in New Issue
Block a user