cpluspluscom / ChessPlusPlus

cplusplus.com Community Project: Modular Chess with support for more types of pieces than traditional Chess
https://cpluspluscom.GitHub.IO/ChessPlusPlus/
35 stars 26 forks source link

Replace factories with global factory pattern #74

Closed LB-- closed 10 years ago

LB-- commented 10 years ago

When I originally made the factory classes, I wasn't happy with how they worked. I've finally gotten around to doing what I originally wanted - now the factory is global and is maintained by the board class, and each piece cpp file has code to register its kind of piece at global initialization time. This means we control which pieces are available just by which cpp files are compiled into the program. There is no need to worry about order of global initialization either.

Please review the changes, make sure they work on your system and that you understand the changes, etc. and let me know of any concerns. If @Thumperrr is OK with it we can go ahead and merge - it shouldn't affect any of our other PRs at the moment, but if it does I'll be there to resolve merge conflicts.