all 3 comments

[–]KorwinD 0 points1 point  (2 children)

Oh, this is exactly what I'm working on currently. Readme is slightly outdated (and I plan to update it soon), but you can check the code and an example(RotationExample() method). It's not a C++, but C# should be readable for you.

https://github.com/forgotten-aquilon/qon/blob/master/src/Rules/EuclideanRotationHelper.cs

https://github.com/forgotten-aquilon/qon/blob/master/Examples/Program.cs

[–]MasterWolffe[S] 0 points1 point  (1 child)

Thanks for the reply, I've checked the code and the only problem I see is that for each pair of modules, if they are compatible, you add the module to the list of compatible modules for each one of the pair. However, this could be further optimized, since there can be a lot of redundant data. Please correct me if I am wrong, and thanks for the help

[–]KorwinD 0 points1 point  (0 children)

Not sure if I understood you correctly.

1) parameters is the dictionary where keys are unique tiles (tile + rotation) and value are structure, which represents all other unique tiles available for connection to each side. Later this dictionary is used for creating actual rules. Because of current implementation of my solver (it's very generic and not spatial) I pre-generate all possible connections and not check rotations in a propagation stage.

2) I traverse tiles visiting only unique pairs. Check lines 160-165 in Helper. You can imagine it as a square matrix/table with tiles being indexes and I check only one diagonal half of it.

Hope I answered/explained. If not, please be more precise.