//
// ControlManager.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 Reloaded.Memory.Sources;
using Remora.Results;
namespace NosSmooth.LocalBinding.Structs;
///
/// Base for player and pet managers.
///
public abstract class ControlManager : NostaleObject
{
///
/// Initializes a new instance of the class.
///
/// The memory.
/// The address of the manager.
protected ControlManager(IMemory memory, nuint address)
: base(memory, address)
{
}
///
/// Gets the entity this control manager is for.
///
public abstract MapBaseObj Entity { get; }
///
/// Gets the current player position x coordinate.
///
public int X
{
get
{
Memory.SafeRead(Address + 0x4, out short x);
return x;
}
}
///
/// Gets the current player position x coordinate.
///
public int Y
{
get
{
Memory.SafeRead(Address + 0x6, out short y);
return y;
}
}
///
/// Gets the target x coordinate the player is moving to.
///
public int TargetX
{
get
{
Memory.SafeRead(Address + 0x8, out short targetX);
return targetX;
}
}
///
/// Gets the target y coordinate the player is moving to.
///
public int TargetY
{
get
{
Memory.SafeRead(Address + 0xA, out short targetX);
return targetX;
}
}
}