Skip to content

Commit

Permalink
ALTV-426 rename class to AABB
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Oct 31, 2024
1 parent f3327cc commit d46be5a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api/AltV.Net.CApi.Generator/TypeRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,6 @@ public static class TypeRegistry
{ "ClrConfigNodeData*", "nint" },
{ "ClrAmmoFlags*", "nint" },
{ "ClrDecoration**", "nint" },
{ "interior_extent_info_t&", "InteriorExtentInfo*" },
{ "aabb_t&", "AABB*" },
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@
namespace AltV.Net.Data
{
[StructLayout(LayoutKind.Sequential)]
public struct InteriorExtentInfo : IEquatable<InteriorExtentInfo>
public struct AABB : IEquatable<AABB>
{
public static InteriorExtentInfo Zero = new InteriorExtentInfo(Position.Zero, Position.Zero);
public static AABB Zero = new AABB(Position.Zero, Position.Zero);

public Position Min;
public Position Max;

public InteriorExtentInfo(Position min, Position max)
public AABB(Position min, Position max)
{
Min = min;
Max = max;
}

public override string ToString()
{
return $"InteriorExtentInfo(min: {Min}, max: {Max})";
return $"AABB(min: {Min}, max: {Max})";
}

public override bool Equals(object obj)
{
return obj is InteriorExtentInfo other && Equals(other);
return obj is AABB other && Equals(other);
}

public bool Equals(InteriorExtentInfo other)
public bool Equals(AABB other)
{
return Min.Equals(other.Min) && Max.Equals(other.Max);
}
Expand Down
6 changes: 3 additions & 3 deletions api/AltV.Net.CApi/Libraries/ClientLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3717,7 +3717,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 3741487677670128934UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 10075699596264467259UL) Outdated = true;
Audio_AddOutput = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<Audio_AddOutputDelegate>(funcTable, 9914412815391408844UL, Audio_AddOutputFallback);
Audio_GetBaseObject = (delegate* unmanaged[Cdecl]<nint, nint>) GetUnmanagedPtr<Audio_GetBaseObjectDelegate>(funcTable, 6330360502401226894UL, Audio_GetBaseObjectFallback);
Audio_GetCurrentTime = (delegate* unmanaged[Cdecl]<nint, double>) GetUnmanagedPtr<Audio_GetCurrentTimeDelegate>(funcTable, 2944324482134975819UL, Audio_GetCurrentTimeFallback);
Expand Down Expand Up @@ -4182,7 +4182,7 @@ public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
HttpClient_Put = (delegate* unmanaged[Cdecl]<nint, nint, nint, ClientEvents.HttpResponseModuleDelegate, void>) GetUnmanagedPtr<HttpClient_PutDelegate>(funcTable, 8280976854604120523UL, HttpClient_PutFallback);
HttpClient_SetExtraHeader = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) GetUnmanagedPtr<HttpClient_SetExtraHeaderDelegate>(funcTable, 4939806300942583161UL, HttpClient_SetExtraHeaderFallback);
HttpClient_Trace = (delegate* unmanaged[Cdecl]<nint, nint, nint, ClientEvents.HttpResponseModuleDelegate, void>) GetUnmanagedPtr<HttpClient_TraceDelegate>(funcTable, 12260251650657662947UL, HttpClient_TraceFallback);
Interior_GetEntitiesExtents = (delegate* unmanaged[Cdecl]<uint, InteriorExtentInfo*, void>) GetUnmanagedPtr<Interior_GetEntitiesExtentsDelegate>(funcTable, 11053057787907413702UL, Interior_GetEntitiesExtentsFallback);
Interior_GetEntitiesExtents = (delegate* unmanaged[Cdecl]<uint, InteriorExtentInfo*, void>) GetUnmanagedPtr<Interior_GetEntitiesExtentsDelegate>(funcTable, 15230725921455826742UL, Interior_GetEntitiesExtentsFallback);
Interior_GetPortalCount = (delegate* unmanaged[Cdecl]<uint, ushort>) GetUnmanagedPtr<Interior_GetPortalCountDelegate>(funcTable, 9833874365185055719UL, Interior_GetPortalCountFallback);
Interior_GetPosition = (delegate* unmanaged[Cdecl]<uint, Vector3>) GetUnmanagedPtr<Interior_GetPositionDelegate>(funcTable, 10883468373939012235UL, Interior_GetPositionFallback);
Interior_GetRoomCount = (delegate* unmanaged[Cdecl]<uint, ushort>) GetUnmanagedPtr<Interior_GetRoomCountDelegate>(funcTable, 15377866266281851140UL, Interior_GetRoomCountFallback);
Expand All @@ -4203,7 +4203,7 @@ public ClientLibrary(Dictionary<ulong, IntPtr> funcTable)
InteriorPortal_SetFlag = (delegate* unmanaged[Cdecl]<uint, uint, int, void>) GetUnmanagedPtr<InteriorPortal_SetFlagDelegate>(funcTable, 9853055316547927459UL, InteriorPortal_SetFlagFallback);
InteriorPortal_SetRoomFrom = (delegate* unmanaged[Cdecl]<uint, uint, uint, void>) GetUnmanagedPtr<InteriorPortal_SetRoomFromDelegate>(funcTable, 12340070947493379575UL, InteriorPortal_SetRoomFromFallback);
InteriorPortal_SetRoomTo = (delegate* unmanaged[Cdecl]<uint, uint, uint, void>) GetUnmanagedPtr<InteriorPortal_SetRoomToDelegate>(funcTable, 16837975631170049766UL, InteriorPortal_SetRoomToFallback);
InteriorRoom_GetExtents = (delegate* unmanaged[Cdecl]<uint, uint, byte, InteriorExtentInfo*, void>) GetUnmanagedPtr<InteriorRoom_GetExtentsDelegate>(funcTable, 6970051561303592745UL, InteriorRoom_GetExtentsFallback);
InteriorRoom_GetExtents = (delegate* unmanaged[Cdecl]<uint, uint, byte, InteriorExtentInfo*, void>) GetUnmanagedPtr<InteriorRoom_GetExtentsDelegate>(funcTable, 8261388998032521861UL, InteriorRoom_GetExtentsFallback);
InteriorRoom_GetFlag = (delegate* unmanaged[Cdecl]<uint, uint, byte, int>) GetUnmanagedPtr<InteriorRoom_GetFlagDelegate>(funcTable, 7856663484428066825UL, InteriorRoom_GetFlagFallback);
InteriorRoom_GetIndex = (delegate* unmanaged[Cdecl]<uint, uint, byte, uint>) GetUnmanagedPtr<InteriorRoom_GetIndexDelegate>(funcTable, 15158102510225914020UL, InteriorRoom_GetIndexFallback);
InteriorRoom_GetName = (delegate* unmanaged[Cdecl]<uint, uint, byte, int*, nint>) GetUnmanagedPtr<InteriorRoom_GetNameDelegate>(funcTable, 4739364089865431579UL, InteriorRoom_GetNameFallback);
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net.CApi/Libraries/ServerLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public ServerLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 3741487677670128934UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 10075699596264467259UL) Outdated = true;
BaseObject_DeleteSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, void>) GetUnmanagedPtr<BaseObject_DeleteSyncedMetaDataDelegate>(funcTable, 8228424877092269355UL, BaseObject_DeleteSyncedMetaDataFallback);
BaseObject_SetMultipleSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint[], nint[], ulong, void>) GetUnmanagedPtr<BaseObject_SetMultipleSyncedMetaDataDelegate>(funcTable, 1390762125822890831UL, BaseObject_SetMultipleSyncedMetaDataFallback);
BaseObject_SetSyncedMetaData = (delegate* unmanaged[Cdecl]<nint, nint, nint, void>) GetUnmanagedPtr<BaseObject_SetSyncedMetaDataDelegate>(funcTable, 8002999088966424231UL, BaseObject_SetSyncedMetaDataFallback);
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net.CApi/Libraries/SharedLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ private IntPtr GetUnmanagedPtr<T>(IDictionary<ulong, IntPtr> funcTable, ulong ha
public SharedLibrary(Dictionary<ulong, IntPtr> funcTable)
{
if (!funcTable.TryGetValue(0, out var capiHash)) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 3741487677670128934UL) Outdated = true;
else if (capiHash == IntPtr.Zero || *(ulong*)capiHash != 10075699596264467259UL) Outdated = true;
Audio_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<Audio_GetIDDelegate>(funcTable, 4464042055475980737UL, Audio_GetIDFallback);
AudioAttachedOutput_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioAttachedOutput_GetIDDelegate>(funcTable, 17725794901805112189UL, AudioAttachedOutput_GetIDFallback);
AudioFilter_GetID = (delegate* unmanaged[Cdecl]<nint, uint>) GetUnmanagedPtr<AudioFilter_GetIDDelegate>(funcTable, 8824535635529306325UL, AudioFilter_GetIDFallback);
Expand Down
2 changes: 1 addition & 1 deletion api/AltV.Net.Client/Elements/Data/IInterior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public interface IInterior
ushort PortalCount { get; }
Position Position { get; }
Rotation Rotation { get; }
InteriorExtentInfo EntitiesExtents { get; }
AABB EntitiesExtents { get; }
}
2 changes: 1 addition & 1 deletion api/AltV.Net.Client/Elements/Data/IInteriorRoom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public interface IInteriorRoom
uint NameHash { get; }
int Flag { get; set; }
uint Timecycle { get; set; }
InteriorExtentInfo Extents { get; set; }
AABB Extents { get; set; }
}
2 changes: 1 addition & 1 deletion runtime

0 comments on commit d46be5a

Please sign in to comment.