makhidkarun / traveller_pyroute

Traveller trade route generator
MIT License
14 stars 5 forks source link

AllyGen seems to do too much #52

Open CyberiaResurrection opened 1 year ago

CyberiaResurrection commented 1 year ago

Tripped over this while doing something else, noting down so I don't forget it:

The current AllyGen class as of this writing does the following: Provide SPOT for whether two allegiance codes are allied for various purposes; Provide SPOT for whether allegiance is imperial, wilds, client state, etc; Creates map borders around various allegiances using one of three separate algorithms.

The natural seam would seem (pardoning the pun) to be splitting the border generation gubbins out into one class per algorithm.

Ideal approach would be to hoist the lot into an Allies namespace, then: AllyGen - contain the allegiance-code related gubbins, and wrap calls to the border-generation gubbins; AlgorithmBase - contain gubbins common to 2 or more border-generation algos; AlgorithmOne - contain the algo-1 related gubbins; AlgorithmTwo - contain the algo-2 related gubbins; AlgorithmThree - contain the algo-3 related gubbins.