public void ReadMemory() { using (var memory = new MemoryAccessor(Pid.Value)) { Remaining = memory.I4(AddrRemaining); Width = memory.I4(AddrWidth); Height = memory.I4(AddrHeight); Time = memory.I4(AddrTime); Mines = memory.Buffer(AddrMine, Mines.Length); } }
public void ReadMemory() { using var memory = new MemoryAccessor(Pid.Value); Remaining = memory.I4(AddrRemaining); Width = memory.I4(AddrWidth); Height = memory.I4(AddrHeight); Time = memory.I4(AddrTime); if ((Width * Height).For(n => 0 < n && n <= Mines.Length)) { Mines = memory.Buffer(AddrMine, Mines.Length); Valid = true; } else { Valid = false; } }