//
// IHookManager.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Remora.Results;
namespace NosSmooth.LocalBinding.Hooks;
///
/// A manager holding all NosTale hooks with actions to execute on all of them.
///
public interface IHookManager
{
///
/// A name of packet send hook.
///
public const string PacketSendName = "NetworkManager.PacketSend";
///
/// A name of packet receive hook.
///
public const string PacketReceiveName = "NetworkManager.PacketReceive";
///
/// A name of character walk hook.
///
public const string CharacterWalkName = "CharacterManager.Walk";
///
/// A name of pet walk hook.
///
public const string PetWalkName = "PetManager.Walk";
///
/// A name of entity follow hook.
///
public const string EntityFollowName = "CharacterManager.EntityFollow";
///
/// A name of entity unfollow hook.
///
public const string EntityUnfollowName = "CharacterManager.EntityUnfollow";
///
/// A name of entity focus hook.
///
public const string EntityFocusName = "UnitManager.EntityFocus";
///
/// A name of periodic hook.
///
public const string PeriodicName = "Periodic";
///
/// Gets the packet send hook.
///
public Optional PacketSend { get; }
///
/// Gets the packet receive hook.
///
public Optional PacketReceive { get; }
///
/// Gets the player walk hook.
///
public Optional PlayerWalk { get; }
///
/// Gets the entity follow hook.
///
public Optional EntityFollow { get; }
///
/// Gets the entity unfollow hook.
///
public Optional EntityUnfollow { get; }
///
/// Gets the player walk hook.
///
public Optional PetWalk { get; }
///
/// Gets the entity focus hook.
///
public Optional EntityFocus { get; }
///
/// Gets the periodic function hook.
///
///
/// May be any function that is called periodically.
/// This is used for synchronizing using .
///
public Optional Periodic { get; }
///
/// Gets all of the hooks.
///
public IReadOnlyList Hooks { get; }
///
/// Initializes all hooks.
///
/// The binding manager.
/// The browser manager.
/// A result that may or may not have failed.
public IResult Initialize(NosBindingManager bindingManager, NosBrowserManager browserManager);
///
/// Enable hooks from the given list.
///
///
/// Use constants from ,
/// such as IHookManager.PacketSendName.
///
/// The hooks to enable.
public void Enable(IEnumerable names);
///
/// Disable hooks from the given list.
///
///
/// Use constants from ,
/// such as IHookManager.PacketSendName.
///
/// The hooks to disable.
public void Disable(IEnumerable names);
///
/// Disable all hooks.
///
public void DisableAll();
///
/// Enable all hooks.
///
public void EnableAll();
///
/// Checks whether hook of the given type is loaded (there were no errors in finding the function).
///
/// The type of the hook.
/// Whether the hook is loaded/present.
public bool IsHookLoaded()
where THook : INostaleHook;
///
/// Checks whether hook of the given type is loaded (there were no errors in finding the function)
/// and that the wrapper function is present/usable.
///
/// The type of the hook.
/// Whether the hook is loaded/present and usable.
public bool IsHookUsable()
where THook : INostaleHook;
///
/// Checks whether hook of the given type is loaded (there were no errors in finding the function).
///
/// The type of the hook.
/// Whether the hook is loaded/present.
public bool IsHookLoaded(Type hookType);
///
/// Checks whether hook of the given type is loaded (there were no errors in finding the function)
/// and that the wrapper function is present/usable.
///
/// The type of the hook.
/// Whether the hook is loaded/present and usable.
public bool IsHookUsable(Type hookType);
}