namespace AcDream.Runtime; public enum RuntimeCommandStatus { Accepted, Inactive, StaleGeneration, Unsupported, Rejected, } public readonly record struct RuntimeCommandResult( RuntimeCommandStatus Status, RuntimeGenerationToken Generation, uint ResultObjectId = 0u) { public bool Accepted => Status == RuntimeCommandStatus.Accepted; } public enum RuntimeSessionStartStatus { Disabled, MissingCredentials, NoCharacters, Connected, Deferred, Failed, Inactive, StaleGeneration, } public readonly record struct RuntimeSessionStartResult( RuntimeSessionStartStatus Status, RuntimeGenerationToken Generation, uint CharacterId = 0u, string CharacterName = "", Exception? Error = null); public enum RuntimeSelectionCommand { SelectClosestHostile, SelectPrevious, ExamineSelected, UseSelected, PickUpSelected, } public enum RuntimeCombatCommand { ToggleMode, } public enum RuntimeMovementCommand { ToggleRunLock, Stop, Ready, Sit, Crouch, Sleep, } public enum RuntimeChatChannel { Say, Tell, Fellowship, Allegiance, Vassals, Patron, Monarch, CoVassals, General, Trade, LookingForGroup, Roleplay, Society, Olthoi, } public readonly record struct RuntimeChatCommand( RuntimeChatChannel Channel, string Text, string? TargetName = null); public enum RuntimePortalCommand { RecallLifestone, RecallMarketplace, RecallHouse, RecallMansion, } public interface IRuntimeSessionCommands { RuntimeSessionStartResult Start(RuntimeGenerationToken expectedGeneration); RuntimeSessionStartResult Reconnect(RuntimeGenerationToken expectedGeneration); RuntimeTeardownAcknowledgement Stop(RuntimeGenerationToken expectedGeneration); } public interface IRuntimeSelectionCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, RuntimeSelectionCommand command); RuntimeCommandResult SelectObject( RuntimeGenerationToken expectedGeneration, uint objectId); RuntimeCommandResult Clear( RuntimeGenerationToken expectedGeneration); } public interface IRuntimeCombatCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, RuntimeCombatCommand command); RuntimeCommandResult ExecuteAttack( RuntimeGenerationToken expectedGeneration, in Gameplay.RuntimeCombatAttackInput command); } public readonly record struct RuntimeMagicCommand(uint SpellId); public interface IRuntimeMagicCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, in RuntimeMagicCommand command); } public interface IRuntimeMovementCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, RuntimeMovementCommand command); RuntimeCommandResult SetIntent( RuntimeGenerationToken expectedGeneration, in Gameplay.MovementInput input); RuntimeCommandResult ClearIntent( RuntimeGenerationToken expectedGeneration); } public interface IRuntimeChatCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, in RuntimeChatCommand command); } public interface IRuntimePortalCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, RuntimePortalCommand command); } public readonly record struct RuntimeShortcutCommand( int Index, uint ObjectId, uint SpellId); public interface IRuntimeInventoryStateCommands { RuntimeCommandResult AddShortcut( RuntimeGenerationToken expectedGeneration, in RuntimeShortcutCommand command); RuntimeCommandResult RemoveShortcut( RuntimeGenerationToken expectedGeneration, int index); } public interface IRuntimeSpellbookCommands { RuntimeCommandResult AddFavorite( RuntimeGenerationToken expectedGeneration, int tabIndex, int position, uint spellId); RuntimeCommandResult RemoveFavorite( RuntimeGenerationToken expectedGeneration, int tabIndex, uint spellId); RuntimeCommandResult SetFilter( RuntimeGenerationToken expectedGeneration, uint filters); RuntimeCommandResult ForgetSpell( RuntimeGenerationToken expectedGeneration, uint spellId); RuntimeCommandResult SetDesiredComponent( RuntimeGenerationToken expectedGeneration, uint componentId, uint amount); RuntimeCommandResult ClearDesiredComponents( RuntimeGenerationToken expectedGeneration); } public enum RuntimeAdvancementKind { Attribute, Vital, Skill, TrainSkill, } public readonly record struct RuntimeAdvancementCommand( RuntimeAdvancementKind Kind, uint StatId, ulong Cost); public interface IRuntimeCharacterCommands { RuntimeCommandResult Advance( RuntimeGenerationToken expectedGeneration, in RuntimeAdvancementCommand command); RuntimeCommandResult SetOptions1( RuntimeGenerationToken expectedGeneration, uint options); } public enum RuntimeFriendCommandKind { Add, Remove, Clear, RequestLegacyList, } public readonly record struct RuntimeFriendCommand( RuntimeFriendCommandKind Kind, uint CharacterId = 0u, string? Name = null); public enum RuntimeSquelchScope { Character, Account, Global, } public readonly record struct RuntimeSquelchCommand( RuntimeSquelchScope Scope, bool Add, uint CharacterId = 0u, string? Name = null, uint MessageType = 0u); public interface IRuntimeSocialCommands { RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, in RuntimeFriendCommand command); RuntimeCommandResult Execute( RuntimeGenerationToken expectedGeneration, in RuntimeSquelchCommand command); } public interface IGameRuntimeCommands { IRuntimeSessionCommands Session { get; } IRuntimeSelectionCommands Selection { get; } IRuntimeCombatCommands Combat { get; } IRuntimeMagicCommands Magic { get; } IRuntimeMovementCommands Movement { get; } IRuntimeChatCommands Chat { get; } IRuntimePortalCommands Portal { get; } IRuntimeInventoryStateCommands InventoryState { get; } IRuntimeSpellbookCommands Spellbook { get; } IRuntimeCharacterCommands Character { get; } IRuntimeSocialCommands Social { get; } }