❔ How do I refactor this?
I am working with a grid of tiles, each tile has an int, which is made up of 4 bytes which represent what value in an enum each side of the tile is in.
This means I have a lot of things that need to run after a few calculations are done in a loop of adjacent tiles
here is most of the repeated code
This seems like a problem that would be solved with a functional language, but how would I allow for a few functions reuse this portion of code, adding a new bit on the end without copying and pasting all the starting stuff
2 Replies
I could pass a func into it, which it runs in there, but I don't know if it would be that clean to do so
I should have really simplified it to this so it is easier to read
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.