public static GP1 FromData(byte[] data, int offset) { var gpkm = new GP1(); Array.Copy(data, offset, gpkm.Data, 0, SIZE); return(gpkm); }
public void DeleteAll() { var blank = new GP1(); for (int i = 0; i < Count; i++) { this[i] = blank; } }
private static bool TryGetGP1(byte[] data, out GP1?gp1) { gp1 = null; if (data.Length != GP1.SIZE || BitConverter.ToUInt32(data, 0x28) == 0) { return(false); } gp1 = new GP1(data); return(true); }
private static bool TryGetGP1(byte[] data, [NotNullWhen(true)] out GP1?gp1) { gp1 = null; if (data.Length != GP1.SIZE || ReadUInt32LittleEndian(data.AsSpan(0x28)) == 0) { return(false); } gp1 = new GP1(data); return(true); }
public GP1[] GetAllEntities() { var value = new GP1[Count]; for (int i = 0; i < value.Length; i++) { value[i] = this[i]; } return(value); }
public const int Count = SlotsPerArea * Areas; // 1000 public GP1 this[int index] { get { Debug.Assert(index < Count); return(GP1.FromData(Data, Offset + (GP1.SIZE * index))); } set { Debug.Assert(index < Count); value.WriteTo(Data, Offset + (GP1.SIZE * index)); } }