AJAntonelli / Tennis-Tourney

1 stars 0 forks source link

Extract all logic out of main.py #3

Open erknuepp opened 2 years ago

erknuepp commented 2 years ago

https://github.com/AJAntonelli/Tennis-Tourney/blob/e0a52f8162d271ffcada2932933481cd8b08d74a/main.py#L19

All the logic should be moved into separate classes e.g. tournament.py, round.py, match.py. I would probably make these instance classes and then each one would also have a play() method for the logic of that piece.

main.py should then just be driving the program, it will call the data class to get the data, call the player class to get the list of players, then it will create a new instance of tournament and call it's play method to kick everything else off.

Feel free to ask questions!

AJAntonelli commented 2 years ago

I haven't put them in classes but I have put them in functions.

erknuepp commented 2 years ago

Cool, I'll check it out when you commit and then I can make a branch on the repo with an example of a static class.