hejcz / carcassonne

0 stars 0 forks source link

Bug in validating river #2

Closed hejcz closed 5 years ago

hejcz commented 5 years ago

https://github.com/hejcz/carcassonne/blob/1eee685b9565ab0ce8362a8d77e8ffdf9d5e6144/src/main/kotlin/io/github/hejcz/river/PutRiverTileValidator.kt#L20

It should check if current tile continous river and is not for example adjacent by green field. Like now it seems it does nto use any current tile info in check.

hejcz commented 5 years ago

So actually there is a check for it. https://github.com/hejcz/carcassonne/blob/1eee685b9565ab0ce8362a8d77e8ffdf9d5e6144/src/main/kotlin/io/github/hejcz/river/PutRiverTileValidator.kt#L13 Here the relative position is calculated so later if there was no river in direction of current tile then error is raised.