Restructure solution

This commit is contained in:
sardelka9515
2022-10-15 11:51:18 +08:00
parent 42c0ef2159
commit d1b4f23992
130 changed files with 458 additions and 578 deletions

57
Core/BitReader.cs Normal file
View File

@ -0,0 +1,57 @@
using GTA.Math;
using System.IO;
using System.Text;
namespace RageCoop.Core
{
internal class BitReader : BinaryReader
{
public BitReader(byte[] array) : base(new MemoryStream(array))
{
}
~BitReader()
{
Close();
Dispose();
}
public byte[] ReadByteArray()
{
return base.ReadBytes(ReadInt32());
}
public override string ReadString()
{
return Encoding.UTF8.GetString(ReadBytes(ReadInt32()));
}
public Vector3 ReadVector3()
{
return new Vector3()
{
X = ReadSingle(),
Y = ReadSingle(),
Z = ReadSingle()
};
}
public Vector2 ReadVector2()
{
return new Vector2()
{
X = ReadSingle(),
Y = ReadSingle()
};
}
public Quaternion ReadQuaternion()
{
return new Quaternion()
{
X = ReadSingle(),
Y = ReadSingle(),
Z = ReadSingle(),
W = ReadSingle()
};
}
}
}