public void AdjustGameScale_ZoomIn_SameCell(int zoomSteps) { (int origCol, int origRow) = _pixelMapper.GetMiddleCoordsOfViewPort(); _pixelMapper.LogData(_output); for (int i = 0; i < zoomSteps; i++) { _pixelMapper.ZoomInPixelMapper(); _pixelMapper.LogData(_output); } (int newCol, int newRow) = _pixelMapper.GetMiddleCoordsOfViewPort(); Assert.Equal(origCol, newCol); Assert.Equal(origRow, newRow); }
public CoordPixelConverstionTests(ITestOutputHelper output) { _output = output; _pixelMapper = new PixelMapper(); _pixelMapper.SetViewPortSize(ScreenSize, ScreenSize); _pixelMapper.LogData(output); if (DefaultCellSize != _pixelMapper.CellSize) { throw new Exception("Cell size is different than this test expects, these tests assume the DefaultCellSize is " + DefaultCellSize); } }
public void ViewPortPixelsToCoords_ZoomedIn_ZeroPosition(int x, int y, int expectedCol, int expectedRow) { _pixelMapper.AdjustGameScale(2.0f); _pixelMapper.SetViewPort(0, 0); _pixelMapper.LogData(_output); (int actualCol, int actualRow) = _pixelMapper.ViewPortPixelsToCoords(x, y); Assert.Equal(expectedCol, actualCol); Assert.Equal(expectedRow, actualRow); }