-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(server): Add VehicleBadge setter
- Loading branch information
Showing
10 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Numerics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace AltV.Net.CApi.Data; | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
public struct VehicleBadgePosition : IEquatable<VehicleBadgePosition> | ||
{ | ||
public VehicleBadgePosition(bool active, byte alpha, float size, short boneIndex, Vector3 offset, Vector3 direction, Vector3 side) | ||
{ | ||
Active = active ? (byte)1 : (byte)0; | ||
Alpha = alpha; | ||
Size = size; | ||
BoneIndex = boneIndex; | ||
Offset = offset; | ||
Direction = direction; | ||
Side = side; | ||
} | ||
|
||
public byte Active { get; set; } = 0; | ||
public byte Alpha { get; set; } = 255; | ||
public float Size { get; set; } = 1f; | ||
public short BoneIndex { get; set; } = 0; | ||
public Vector3 Offset { get; set; } = new(0, 0, 0); | ||
public Vector3 Direction { get; set; } = new(0, 0, 0); | ||
public Vector3 Side { get; set; } = new(0, 0, 0); | ||
|
||
public bool Equals(VehicleBadgePosition other) | ||
{ | ||
return Active == other.Active && Alpha == other.Alpha && Size.Equals(other.Size) && BoneIndex == other.BoneIndex && Offset.Equals(other.Offset) && Direction.Equals(other.Direction) && Side.Equals(other.Side); | ||
} | ||
|
||
public override bool Equals(object? obj) | ||
{ | ||
return obj is VehicleBadgePosition other && Equals(other); | ||
} | ||
|
||
public override int GetHashCode() => HashCode.Combine(Active.GetHashCode(), Alpha.GetHashCode(), Size.GetHashCode(), BoneIndex.GetHashCode(), Offset.GetHashCode(), Direction.GetHashCode(), Side.GetHashCode()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule runtime
updated
6 files
+2 −0 | c-api/cache/CachedVehicle.h | |
+12 −1 | c-api/data/types.h | |
+34 −0 | c-api/entities/vehicle.cpp | |
+2 −0 | c-api/entities/vehicle.h | |
+3 −1 | c-api/func_table.cpp | |
+1 −1 | cpp-sdk |