func (c Canvas) calculateSelectedTiles() map[tile.ID]tileSelection {
	minX, maxX := sort(c.selection.start.x, c.selection.end.x)
	minY, maxY := sort(c.selection.start.y, c.selection.end.y)
	selectedUnusedTileIds := c.calculateSelectedUnusedTiles(minX, maxX, minY, maxY)
	selectedUsedTileIds := c.calculateSelectedUsedTiles(minX, maxX, minY, maxY)
	switch {
	case len(selectedUnusedTileIds) == 0:
		return selectedUsedTileIds
	case len(selectedUsedTileIds) != 0:
		return nil // cannot select used and unused tiles
	default:
		return selectedUnusedTileIds
	}
}
// calculateSelectedTiles determines which tiles are selected from the selection.
calculateSelectedTiles determines which tiles are selected from the selection.
// calculateSelectedTiles determines which tiles are selected from the selection .
func (c Canvas) calculateSelectedTiles() map[tile.ID]tileSelection {
	minX, maxX := sort(c.selection.start.x, c.selection.end.x)
	minY, maxY := sort(c.selection.start.y, c.selection.end.y)
	selectedUnusedTileIds := c.calculateSelectedUnusedTiles(minX, maxX, minY, maxY)
	selectedUsedTileIds := c.calculateSelectedUsedTiles(minX, maxX, minY, maxY)
	switch {
	case len(selectedUnusedTileIds) == 0:
		return selectedUsedTileIds
	case len(selectedUsedTileIds) != 0:
		return nil 
	default:
		return selectedUnusedTileIds
	}
}
func ( c Canvas ) calculateSelectedTiles ( ) map [ tile . ID ] tileSelection { minX , maxX := sort ( c . selection . start . x , c . selection . end . x ) minY , maxY := sort ( c . selection . start . y , c . selection . end . y ) selectedUnusedTileIds := c . calculateSelectedUnusedTiles ( minX , maxX , minY , maxY ) selectedUsedTileIds := c . calculateSelectedUsedTiles ( minX , maxX , minY , maxY ) switch { case len ( selectedUnusedTileIds ) == 0 : return selectedUsedTileIds case len ( selectedUsedTileIds ) != 0 : return nil default : return selectedUnusedTileIds } }
calculateSelectedTiles determines which tiles are selected from the selection.
calculateSelectedTiles determines which tiles are selected from the selection .
// cannot select used and unused tiles