//
// PetManager.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 NosSmooth.LocalBinding.Errors;
using NosSmooth.LocalBinding.Options;
using Reloaded.Memory.Sources;
using Remora.Results;
namespace NosSmooth.LocalBinding.Structs;
///
/// NosTale pet manager.
///
public class PetManager : ControlManager
{
private readonly IMemory _memory;
///
/// Initializes a new instance of the class.
///
/// The memory.
/// The pet manager address.
public PetManager(IMemory memory, IntPtr petManagerAddress)
: base(memory)
{
_memory = memory;
Address = petManagerAddress;
}
///
/// Gets the address of the pet manager.
///
public override IntPtr Address { get; }
///
/// Gets the player object.
///
public MapNpcObj Pet
{
get
{
_memory.SafeRead(Address + 0x20, out int playerAddress);
return new MapNpcObj(_memory, (IntPtr)playerAddress);
}
}
}