//
// MapBaseObj.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;
namespace NosSmooth.LocalBinding.Structs;
///
/// Base map object. Common for players, monsters, npcs.
///
public class MapBaseObj
{
private readonly IMemory _memory;
private readonly IntPtr _mapObjPointer;
///
/// Initializes a new instance of the class.
///
/// The memory.
/// The map object pointer.
public MapBaseObj(IMemory memory, IntPtr mapObjPointer)
{
_memory = memory;
_mapObjPointer = mapObjPointer;
}
///
/// Gets the pointer to the object.
///
public IntPtr Address => _mapObjPointer;
///
/// Gets the id of the entity.
///
public long Id
{
get
{
_memory.SafeRead(_mapObjPointer + 0x08, out int id);
return id;
}
}
}