Open SquirrelsMcGee opened 10 months ago
Note: I haven't actually built this on my end, as i'm writing this during my lunch break at work 😛
Yeah, there's a lot of refactoring possibilities. I just moved the game directory to a JSON file, but of course I didn't touch the hacky handling side much.
This is what happens when you write a hacky script for one game and then try to add more games without refactoring the whole script :sweat_smile:
Hi I just used this tool and found it really useful and was wondering how the code actually worked
It was all very interesting but I've noticed an issue that is starting to creep up as more games get supported
In main.py in the get_save_paths function, it looks like you're pulling from a list of known handlers to get the name and what required arguments each handler needs, but then you are performing a series of if-elif statements to perform the extraction for each game, this isn't really scalable, as more games gets added, the script will just keep getting bigger and more complex, ideally you would separate out the handler implementation from the rest of the code
A small code quality improvement you could make here is to move the content of each block into it's own seperate function / class, then register each of those in a dictionary using the handler_key as the key
psuedo-code example: