acdream/src/AcDream.Plugin.Abstractions/FellowshipAutomation.cs

72 lines
2.6 KiB
C#

namespace AcDream.Plugin.Abstractions;
/// <summary>One authoritative fellowship-roster entry plus live range.</summary>
public readonly record struct PluginFellowMember(
uint ObjectId,
string Name,
uint CurrentHealth,
uint MaxHealth,
uint CurrentStamina,
uint MaxStamina,
uint CurrentMana,
uint MaxMana,
float Distance)
{
/// <summary>
/// The member's authoritative fellowship Share Loot bit. VTank permits
/// immediate corpse access for a fellow only when this bit is set; a
/// non-sharing fellow's corpse remains protected for retail's 100-second
/// public-loot interval.
/// </summary>
public bool ShareLoot { get; init; }
}
public enum PluginFellowshipCommandStatus
{
Unavailable = 0,
Accepted,
Rejected,
}
public readonly record struct PluginFellowshipCommandResult(
PluginFellowshipCommandStatus Status)
{
public bool Accepted => Status == PluginFellowshipCommandStatus.Accepted;
}
/// <summary>
/// Group state and generation-gated retail fellowship commands. Recruitment,
/// waiting lists, voting, and social policy remain plugin behavior; the host
/// only exposes the canonical wire operations already used by the retail UI.
/// </summary>
public interface IFellowshipAutomation
{
bool IsInFellowship => false;
string Name => string.Empty;
uint LeaderObjectId => 0u;
bool IsOpen => false;
bool IsLocked => false;
int MemberCount => 0;
IReadOnlyList<PluginFellowMember> CaptureMembers() =>
Array.Empty<PluginFellowMember>();
/// <summary>
/// Complete authoritative roster in server insertion order, including the
/// local player. Use <see cref="CaptureMembers"/> for helper/healer policy
/// that intentionally excludes self.
/// </summary>
IReadOnlyList<PluginFellowMember> CaptureRoster() => CaptureMembers();
PluginFellowshipCommandResult Create(string name, bool shareExperience) =>
new(PluginFellowshipCommandStatus.Unavailable);
PluginFellowshipCommandResult Recruit(uint targetObjectId) =>
new(PluginFellowshipCommandStatus.Unavailable);
PluginFellowshipCommandResult Dismiss(uint targetObjectId) =>
new(PluginFellowshipCommandStatus.Unavailable);
PluginFellowshipCommandResult Quit(bool disband) =>
new(PluginFellowshipCommandStatus.Unavailable);
PluginFellowshipCommandResult AssignLeader(uint targetObjectId) =>
new(PluginFellowshipCommandStatus.Unavailable);
PluginFellowshipCommandResult SetOpen(bool isOpen) =>
new(PluginFellowshipCommandStatus.Unavailable);
}