This commit is contained in:
CortexCore
2025-02-24 23:02:49 +08:00
parent 9775bdd099
commit b07ae4fea7
82 changed files with 1021 additions and 386 deletions

View File

@@ -6,76 +6,35 @@ using BITKit.StateMachine;
namespace Net.Project.B.Inventory
{
/// <summary>
/// 玩家武器槽
/// </summary>
public enum PlayerWeaponSlot
{
/// <summary>
/// 主武器
/// </summary>
Primary,
/// <summary>
/// 主武器2
/// </summary>
Secondary,
/// <summary>
/// 副武器,例如手枪,近战武器等
/// </summary>
Sidearm,
/// <summary>
/// 消耗品,通常是护甲,医疗包等
/// </summary>
Supplies,
/// <summary>
/// 战术道具
/// </summary>
Tactics,
/// <summary>
/// 致命道具
/// </summary>
Lethal,
/// <summary>
/// 连杀奖励,特别的武器
/// </summary>
KillStreak
}
/// <summary>
/// 玩家武器控制器
/// 玩家控制器
/// </summary>
public interface IPlayerWeaponController:IStateAsync{}
/// <summary>
/// 玩家枪支控制器
/// 玩家泛型控制器
/// </summary>
public interface IPlayerGunController:IPlayerWeaponController{}
/// <summary>
/// 玩家近战武器控制器
/// </summary>
public interface IPlayerMeleeController:IPlayerWeaponController{}
/// <typeparam name="T"></typeparam>
public interface IPlayerWeaponController<T>:IPlayerWeaponController{}
/// <summary>
/// 玩家武器库存,与背包不是一个东西
/// </summary>
public interface IPlayerWeaponInventory
{
/// <summary>
/// 武器
/// 允许使用武器
/// </summary>
public IReadOnlyDictionary<PlayerWeaponSlot,int> WeaponSlots { get; }
public ValidHandle AllowWeapon { get; }
/// <summary>
/// 武器控制器状态机
/// </summary>
public IStateMachine<IPlayerWeaponController> StateMachine { get; }
/// <summary>
/// 武器槽更新回调,参数为:slot,ItemId,IsAdd
/// </summary>
public event Action<PlayerWeaponSlot, int, bool> OnWeaponSlotChanged;
/// <summary>
/// 丢下武器
/// </summary>
/// <param name="slot"></param>
void Drop(PlayerWeaponSlot slot);
void Use(PlayerWeaponSlot slot);
void Use(int id);
/// <param name="itemId"></param>
void Drop(int itemId);
void Draw(int itemId);
}
}