From a643f7aea9ad1dc48c7602b6131db0691706988d Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Mon, 22 Sep 2025 21:38:45 +0200 Subject: [PATCH] Delete CS2-SimpleAdminApi/Vector_t.cs --- CS2-SimpleAdminApi/Vector_t.cs | 105 --------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 CS2-SimpleAdminApi/Vector_t.cs diff --git a/CS2-SimpleAdminApi/Vector_t.cs b/CS2-SimpleAdminApi/Vector_t.cs deleted file mode 100644 index e01c214..0000000 --- a/CS2-SimpleAdminApi/Vector_t.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace CS2_SimpleAdminApi; - -public struct Vector_t : IAdditionOperators, - ISubtractionOperators, - IMultiplyOperators, - IDivisionOperators -{ - public float X, Y, Z; - - public const int SIZE = 3; - - public unsafe float this[int i] - { - readonly get - { - if (i < 0 || i > SIZE) - { - throw new IndexOutOfRangeException(); - } - - fixed (void* ptr = &this) - { - return Unsafe.Read(Unsafe.Add(ptr, i)); - } - } - set - { - if (i < 0 || i > SIZE) - { - throw new IndexOutOfRangeException(); - } - - fixed (void* ptr = &this) - { - Unsafe.Write(Unsafe.Add(ptr, i), value); - } - } - } - - public Vector_t() - { - } - - public unsafe Vector_t(nint ptr) : this(MemoryMarshal.CreateReadOnlySpan(ref Unsafe.AsRef((void*)ptr), SIZE)) - { - } - - public Vector_t(float x, float y, float z) - { - X = x; - Y = y; - Z = z; - } - - public Vector_t(ReadOnlySpan values) - { - if (values.Length < SIZE) - { - throw new ArgumentOutOfRangeException(nameof(values)); - } - - this = Unsafe.ReadUnaligned(ref Unsafe.As(ref MemoryMarshal.GetReference(values))); - } - - public void Scale(float scale) - { - X *= scale; - Y *= scale; - Z *= scale; - } - - public readonly override string ToString() - { - return $"{X:n2} {Y:n2} {Z:n2}"; - } - - public static Vector_t operator +(Vector_t a, Vector_t b) - { - return new Vector_t(a.X + b.X, a.Y + b.Y, a.Z + b.Z); - } - - public static Vector_t operator -(Vector_t a, Vector_t b) - { - return new Vector_t(a.X - b.X, a.Y - b.Y, a.Z - b.Z); - } - - public static Vector_t operator -(Vector_t a) - { - return new Vector_t(-a.X, -a.Y, -a.Z); - } - - public static Vector_t operator *(Vector_t a, float b) - { - return new Vector_t(a.X * b, a.Y * b, a.Z * b); - } - - public static Vector_t operator /(Vector_t a, float b) - { - return new Vector_t(a.X / b, a.Y / b, a.Z / b); - } -} \ No newline at end of file