private static void DrawMap() { // Clear current data from console NCurses.Erase(); // Calculate available console space. NCurses.GetMaxYX(_window, out int height, out int width); // Resize viewport as needed to match console size _mapView.ResizeViewport(width, height); // Change each character of the console as appropriate foreach (var pos in _mapView.CurrentViewport.Positions()) { NCurses.Move(pos.Y, pos.X); NCurses.InsertChar(_mapView.CurrentViewport[pos]); } // Render data to screen NCurses.Refresh(); // Reset dirty flag because we just drew _dirty = false; }