using System;
using Microsoft.SqlServer.Server;
namespace BITKit
{
///
/// 支持二进制化的的物品容器,适用于网络化物品容器
/// 支持属性
/// 支持回调
///
public interface IRuntimeItemContainer:IBinarySerialize
{
///
/// 物品容器的唯一Id
///
int Id { get; }
///
/// 获取所有Item的只读副本
///
IRuntimeItem[] GetItems();
///
/// 添加物品的接口
///
bool Add(IRuntimeItem item);
///
/// 通过Id移除物品(推荐)
///
bool Remove(int id);
///
/// 通过通过Id丢下物品
///
bool Drop(int id);
///
/// 注册添加物品的工厂方法,
///
event Func AddFactory;
///
/// 注册移除物品的工厂方法
///
event Func RemoveFactory;
///
/// 注册丢下物品的工厂方法
///
event Func DropFactory;
///
/// 已添加Item的回调
///
event Action OnAdd;
///
/// 已移除Item的回调
///
event Action OnRemove;
///
/// 已设置Item的回调
///
event Action OnSet;
///
/// 已丢下Item的回调
///
event Action OnDrop;
///
/// 已重构Items的回调
///
event Action OnRebuild;
///
/// 是否已完成物品交换,例如false就是开始交换物品true就是已完成交换物品,可以处理物品了
///
event Action OnRelease;
}
}