Repository navigation
Minor issues fixes - #2027
Minor issues fixes#2027
Conversation
Signed-off-by: Grigory Pomadchin <[email protected]>
3b5840a to
cb110f1
Compare
Signed-off-by: Grigory Pomadchin <[email protected]>
cb110f1 to
67e93c6
Compare
| */ | ||
| case class TileLayout(layoutCols: Int, layoutRows: Int, tileCols: Int, tileRows: Int) { | ||
|
|
||
| assert( |
There was a problem hiding this comment.
should use require in these cases, that gives more relevant exception.
| assert( | ||
| layoutCols >= 0 && layoutRows >= 0 && tileCols >= 0 && tileRows >= 0, | ||
| s"TileLayout should contain cols and rows >= 0: " + | ||
| s"TileLayout(layoutCols = $layoutCols, layoutRows = $layoutRows, tileCols = $tileCols, tileRows = $tileRows)" |
There was a problem hiding this comment.
I think its fine to use .toString in these cases even though it doesn't have field labels its a little more tenable as a pattern.
|
#2021 work would be done in a separate PR; only descriptive failure messages were introduced in this PR at least to reduce pain. |
| val layout = level.layout | ||
|
|
||
| if(layout.layoutCols < 2 || layout.layoutRows < 2) | ||
| sys.error( |
There was a problem hiding this comment.
This is too late to give this exception. At this point a couple of pyramid levels would have already been saved and all that work would have been wasted.
Its possible to give this exception before we start the pyramid but now the nature of this error depends on work in the broken out PR. I would say lets remove this exception here and deal with the issue fully in separate PR.
11339f6 to
3632a61
Compare
| case class TileLayout(layoutCols: Int, layoutRows: Int, tileCols: Int, tileRows: Int) { | ||
|
|
||
| require( | ||
| layoutCols >= 0 && layoutRows >= 0 && tileCols >= 0 && tileRows >= 0, |
There was a problem hiding this comment.
> not >=, need at least one pixel or a tile in the tile/layout.
Signed-off-by: Grigory Pomadchin <[email protected]>
Signed-off-by: Grigory Pomadchin <[email protected]>
Signed-off-by: Grigory Pomadchin <[email protected]>
feee027 to
e504cad
Compare
Signed-off-by: Grigory Pomadchin <[email protected]>
|
This seems fine for |
Resolves #2022
Resolves #2012
Resolves #2026