Update structure types to record structs (#326)
This commit is contained in:
parent
7db9848fb2
commit
a31a4eb3ca
7 changed files with 8 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ namespace Raylib_cs;
|
|||
|
||||
/// <summary>Bounding box type</summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public partial struct BoundingBox
|
||||
public partial record struct BoundingBox
|
||||
{
|
||||
/// <summary>
|
||||
/// Minimum vertex box-corner
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Raylib_cs;
|
|||
/// Camera2D, defines position/orientation in 2d space
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Camera2D
|
||||
public record struct Camera2D
|
||||
{
|
||||
/// <summary>
|
||||
/// Camera offset (displacement from target)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public enum CameraProjection
|
|||
/// Camera3D, defines position/orientation in 3d space
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Camera3D
|
||||
public record struct Camera3D
|
||||
{
|
||||
/// <summary>
|
||||
/// Camera position
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Raylib_cs;
|
|||
/// Color type, RGBA (32bit)
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Color
|
||||
public record struct Color
|
||||
{
|
||||
public byte R;
|
||||
public byte G;
|
||||
|
|
@ -221,9 +221,4 @@ public struct Color
|
|||
{
|
||||
return (byte)(a + (b - a) * t);
|
||||
}
|
||||
|
||||
public readonly override string ToString()
|
||||
{
|
||||
return $"{{R:{R} G:{G} B:{B} A:{A}}}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Raylib_cs;
|
|||
/// Ray, ray for raycasting
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Ray
|
||||
public record struct Ray
|
||||
{
|
||||
/// <summary>
|
||||
/// Ray position (origin)
|
||||
|
|
@ -30,7 +30,7 @@ public struct Ray
|
|||
/// Raycast hit information
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RayCollision
|
||||
public record struct RayCollision
|
||||
{
|
||||
/// <summary>
|
||||
/// Did the ray hit something?
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Raylib_cs;
|
|||
/// Rectangle type
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rectangle
|
||||
public record struct Rectangle
|
||||
{
|
||||
public float X;
|
||||
public float Y;
|
||||
|
|
@ -106,9 +106,4 @@ public struct Rectangle
|
|||
Width -= shrink * 2.0f;
|
||||
Height -= shrink * 2.0f;
|
||||
}
|
||||
|
||||
public readonly override string ToString()
|
||||
{
|
||||
return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Raylib_cs;
|
|||
/// Transform, vertex transformation data
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Transform
|
||||
public record struct Transform
|
||||
{
|
||||
/// <summary>
|
||||
/// Translation
|
||||
|
|
|
|||
Loading…
Reference in a new issue