ChessPlusPlus Cont.

closed account (18hRX9L8)
Hi guys,

I have been working on a knockoff version of ChessPlusPlus and here is what I have so far: https://github.com/usandfriends/ChessPlusPlus . Currently, I have proper move and capture highlights showing and player turns working.

I'm trying to learn how your guys's setup works. Hopefully, after I build the game, I will understand how it works and contribute something useful.

- Usandfriends
closed account (o1vk4iN6)
Well i have a suggestion, use more than one source file and there are so many tabs to the point half the screen is just whitespace that goes on for almost 900 lines :/.

https://github.com/usandfriends/ChessPlusPlus/blob/master/Visual%20Studio/ChessPlusPlus.cpp#L740
Last edited on
closed account (18hRX9L8)
The README.md tells you that I am starting to split up ChessPlusPlus.cpp into many headers (like in the XCode directory).
Last edited on
closed account (o1vk4iN6)
Well that's another thing... i mean why did you duplicate the code for each platform ? That's overkill.
closed account (3qX21hU5)
I agree with xerzi on this one. I would suggest looking into creating a CMakeList which can be used to build a solution for different IDE's and compilers. It might take a little bit to gain the knowledge required to write a CMakeList but in the end it is a very handy skill to have and will simplify your building process greatly.
Last edited on
closed account (18hRX9L8)
Okay, thank you Zereo. I will look into CMakeLists.

Edit:
Oh wait, couldn't I also check for what OS the user is using?

Like:
1
2
3
4
5
#if OS == '__WIN__'
#include "only_for_windows.h"
#elif OS == '__OSX__'
#include "only_for_osx.h"
...
Last edited on
1
2
3
4
5
6
7
#if defined( _WIN32)
    #include <Windows.h>
#elif defined(__linux__)
    #include<posix.h>
#elif defined(__APPLE__)
    #include<some_mac_header>
#endif 

http://sourceforge.net/p/predef/wiki/OperatingSystems/
Last edited on
closed account (18hRX9L8)
Ah, thank you naraku9333.
Will make the changes soon.
Last edited on
Topic archived. No new replies allowed.