using System;
using System.Runtime.InteropServices;

namespace SharpQuake
{
	[StructLayout(LayoutKind.Explicit)]
	internal struct Union4b
	{
		public Union4b(byte b0, byte b1, byte b2, byte b3)
		{
			this.ui0 = 0u;
			this.i0 = 0;
			this.f0 = 0f;
			this.s0 = 0;
			this.s1 = 0;
			this.us0 = 0;
			this.us1 = 0;
			this.b0 = b0;
			this.b1 = b1;
			this.b2 = b2;
			this.b3 = b3;
		}

		[FieldOffset(0)]
		public uint ui0;

		[FieldOffset(0)]
		public int i0;

		[FieldOffset(0)]
		public float f0;

		[FieldOffset(0)]
		public short s0;

		[FieldOffset(2)]
		public short s1;

		[FieldOffset(0)]
		public ushort us0;

		[FieldOffset(2)]
		public ushort us1;

		[FieldOffset(0)]
		public byte b0;

		[FieldOffset(1)]
		public byte b1;

		[FieldOffset(2)]
		public byte b2;

		[FieldOffset(3)]
		public byte b3;

		public static readonly Union4b Empty = new Union4b(0, 0, 0, 0);
	}
}
