public bool MoveNext() { _lockedSector?.Dispose(); if (_currentX >= _endX || _currentY >= _endY) { return(false); } var secX = _currentX / 64; var remX = _currentX % 64; var secY = _currentY / 64; var remY = _currentY % 64; var w = Math.Min(64 - remX, _endX - _currentX); var h = Math.Min(64 - remY, _endY - _currentY); var sectorLoc = new SectorLoc(secX, secY); if (_lockSectors) { _lockedSector = new LockedMapSector(sectorLoc); } Current = new PartialSector( sectorLoc, w < 64 || h < 64, new Rectangle(remX, remY, w, h), _lockedSector ); _currentX += w; if (_currentX >= _endX) { _currentX = _tileRectangle.Left; _currentY += h; } return(true); }
public bool Equals(PartialSector other) { return(SectorLoc.Equals(other.SectorLoc) && FullSector == other.FullSector && other.TileRectangle.Equals(TileRectangle)); }