public void CreateSimulatedGridOriginal() { _simulatedGridOriginal = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight]; for (int y = 0; y < _setting.GridHeight; y++) { for (int x = 0; x < _setting.GridWidth; x++) { if (_grid[x, y] != null) { _simulatedGridOriginal[x, y] = new SimulatedBlock(_grid[x, y]); } } } _simulatedGrid = new SimulatedBlock[_setting.GridWidth, _setting.GridHeight]; CopyOriginalToSimulatedGrid(); if (_grid.CurrentGroup == null) { return; } _simulatedGroup = new SimulatedGroup(); _simulatedGroup.Simulate(_grid.CurrentGroup); }
public void LocationShouldBeAffectedByLocationInTheGroup() { var block = new SimulatedBlock(); block.LocationInTheGroup = new Coord(0, 2); block.SetLocation(new Coord(1, 2)); Assert.AreEqual(new Coord(1, 4), block.Location); }
public void ShouldIgnoreLocationInTheGroupWhenFixedOnGridIsTrue() { var block = new SimulatedBlock(); block.LocationInTheGroup = new Coord(0, 2); block.FixedOnGrid = true; block.SetLocation(new Coord(1, 2)); Assert.AreEqual(new Coord(1, 2), block.Location); }