Hexworks / mixite

A GUI agnostic hexagonal grid library. Supports a multitude of grid layouts including hexagonal, triangular, rectangular and more.
Apache License 2.0
191 stars 31 forks source link

calculateRingFrom function always returns an empty set #55

Closed Welcius closed 4 years ago

Welcius commented 4 years ago

The calculateRingFrom function is not correct since the return set is never modified, so it's always empty.

Take a look at the implementation here:

https://github.com/Hexworks/mixite/blob/97cf0d0ccce96401318aaa5c4e474310b6cf38ac/mixite.core/core/src/main/kotlin/org/hexworks/mixite/core/internal/impl/HexagonalGridCalculatorImpl.kt

Welcius commented 4 years ago

Also, I think that there is a for loop missing as well, it should loop between neighborIndexes 0..5 (if you check, neighborIndex is never modified).

adam-arold commented 4 years ago

You're right. I'm not sure how it ended up this way (I don't remember) but I think that this is an incomplete implementation.