Skip to content

Commit

Permalink
refactor: Native type names
Browse files Browse the repository at this point in the history
  • Loading branch information
Pd233 committed May 9, 2024
1 parent 7f560a3 commit 79f4f35
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/AABB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class AABB")]
[StructLayout(LayoutKind.Sequential)]
public unsafe struct AABB
{
Expand Down
2 changes: 1 addition & 1 deletion src/BlockPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName ="class BlockPos")]
[StructLayout(LayoutKind.Sequential)]
public unsafe struct BlockPos(int x, int y, int z)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ChunkBlockPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class ChunkLocalHeight")]
[StructLayout(LayoutKind.Sequential)]
public struct ChunkLocalHeight(short v)
{
Expand All @@ -21,7 +21,7 @@ public static implicit operator ChunkLocalHeight(short v)
}
}

[PredefinedType]
[PredefinedType(TypeName = "class ChunkBlockPos")]
[StructLayout(LayoutKind.Sequential)]
public struct ChunkBlockPos(byte x, short y, byte z)
{
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class ChunkPos")]
[StructLayout(LayoutKind.Sequential)]
public struct ChunkPos(int ix, int iz)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Enum/MinecraftPacketIds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "enum class MinecraftPacketIds")]
public enum MinecraftPacketIds
{
KeepAlive = 0x0,
Expand Down
4 changes: 3 additions & 1 deletion src/Hosihikari.Minecraft.Foundation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hosihikari.NativeInterop" Version="1.0.8"/>
<Reference Include="Hosihikari.NativeInterop">
<HintPath>..\..\NativeInterop\src\bin\Release\net8.0\Hosihikari.NativeInterop.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Mce/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Hosihikari.Minecraft.Mce;

[StructLayout(LayoutKind.Sequential)]
[PredefinedType(NativeTypeName = "Color", NativeTypeNamespace = "mce")]
[PredefinedType(TypeName = "class mce::Color")]
public struct Color(float r, float g, float b, float a)
{
public float R = r;
Expand Down
2 changes: 1 addition & 1 deletion src/Mce/UUID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Hosihikari.Minecraft.Mce;

[StructLayout(LayoutKind.Sequential)]
[PredefinedType(NativeTypeName = "UUID", NativeTypeNamespace = "mce")]
[PredefinedType(TypeName = "class mce::UUID")]
public struct UUID(ulong a, ulong b)
{
public ulong A = a;
Expand Down
2 changes: 1 addition & 1 deletion src/SubChunkPos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class SubChunkPos")]
[StructLayout(LayoutKind.Sequential)]
public struct SubChunkPos(int x, int y, int z)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Vec2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class Vec2")]
[StructLayout(LayoutKind.Sequential)]
public struct Vec2(float x, float y)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Vec3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Hosihikari.Minecraft;

[PredefinedType]
[PredefinedType(TypeName = "class Vec3")]
[StructLayout(LayoutKind.Sequential)]
public struct Vec3(float x, float y, float z)
{
Expand Down

0 comments on commit 79f4f35

Please sign in to comment.