namespace AcDream.Plugin.Abstractions;
/// One owned item that can participate in VTank equipment policy.
public readonly record struct PluginEquipmentItem(
uint ObjectId,
string Name,
uint ItemType,
uint ValidLocations,
uint EquippedLocation,
uint ContainerObjectId,
uint WielderObjectId,
byte CombatUse,
int DamageType,
int WeaponSkill,
int Damage,
double DamageVariance)
{
public bool IsEquipped => EquippedLocation != 0u;
/// Retail AMMO_TYPE bit from PublicWeenieDesc.
public uint AmmoType { get; init; }
public int StackSize { get; init; } = 1;
public int WeaponType { get; init; }
}
public enum PluginEquipmentCommandStatus
{
Unavailable = 0,
InvalidItem,
Busy,
AlreadyEquipped,
Started,
Refused,
}
public readonly record struct PluginEquipmentCommandResult(
PluginEquipmentCommandStatus Status,
string? Notice = null)
{
public bool Accepted => Status is
PluginEquipmentCommandStatus.AlreadyEquipped
or PluginEquipmentCommandStatus.Started;
}
///
/// Borrowed inventory equipment view and one request through the client's
/// canonical confirmed AutoWield transaction.
///
public interface IEquipmentAutomation
{
bool IsAvailable => false;
bool IsBusy => false;
IReadOnlyList CaptureOwnedEquipment() =>
Array.Empty();
///
/// Zero asks retail AutoWield to choose; otherwise this is the exact
/// retail INVENTORY_LOC bit requested by a profile.
///
PluginEquipmentCommandResult Equip(
uint objectId,
uint requestedLocation = 0u) =>
new(PluginEquipmentCommandStatus.Unavailable);
}