Exemplo n.º 1
0
        public static GP1 FromData(byte[] data, int offset)
        {
            var gpkm = new GP1();

            Array.Copy(data, offset, gpkm.Data, 0, SIZE);
            return(gpkm);
        }
Exemplo n.º 2
0
        public void DeleteAll()
        {
            var blank = new GP1();

            for (int i = 0; i < Count; i++)
            {
                this[i] = blank;
            }
        }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        public GP1[] GetAllEntities()
        {
            var value = new GP1[Count];

            for (int i = 0; i < value.Length; i++)
            {
                value[i] = this[i];
            }
            return(value);
        }
Exemplo n.º 6
0
        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));
            }
        }