Contributions policy

Recently I’ve been glancing through the source code of GT6 in order to do some tweaks for my own use. And I’m noticing that some pieces of code are manually duplicated multiple times with differences only in constants. For example, in code related to dungeon generation.

I think I might refactor some of these code into something shorter and more structured, with more loops instead of manual duplicates. But coding styles and tastes vary, and I wonder whether these kinds of pull requests might be welcomed (i.e. having any non-zero chance to possibly be accepted).

The behaviour will not change, nor will the part exposed to outside the class. Only the way that the code is structured.

2 Likes

Sorry but this type of thing will not be accepted, especially since you are trying to de-duplicate something that is already de-duplicated. The Code may look similar each time but it always does different things.

Also it is structured so it is readable in this case, so any changes will inevitably make it less readable.

2 Likes

The coordinates change, but in a regular way. I could use some arithmetic instead, and doubly check that it indeed does the same thing as before.

But since you say no, I got it.

2 Likes

In a regular way? It already does things with a System, what exactly would you even do to change it?

1 Like

Starting from

these 4 consecutive "if"s could be merged, with the coordinates calculated from loop variables.

2 Likes

But at that point you would need to do mental rotations every time you change anything in the code, which is why i did not code it like that.

2 Likes

So you’d rather hardcode individual coordinate points instead of relying on symmetries and doing mental rotations. That’s indeed personal variations. Hmm, I see.
I guess it was a good choice to have decided to ask, then.

2 Likes