Well that header would be the easy part, the hard part would be that C# is fairly restrictive of a lot of things than C++.
True enough. That said, the header file is a list of most of the new code that needs writing, as opposed to old code that needs to be rewritten. By that I mean it's the work that can be done without requiring specific experience with the LCS codebase. Any progress people make on implementation of those functions can be made without fear of stepping on my toes.
For example, there's no multiple inheritance in C#, so any multiple inheritance in C++ would probably be best to just refactor away before the port.
Not to worry, there's no multiple inheritance in LCS. Barely any inheritance at all, since LCS uses so little object oriented programming, which is a problem in the other direction.
Also, C# doesn't have C++ style pointers and references, it has a single reference type that can be null, similar to C++ pointers.
That... that is going to be a pain. Not going to lie.
C# also has several more Java-like requirements that almost everything needs to be inside a class in C#, and that could impact some things too.
Certainly. Most of the refactorings I've done over the past year have been to help porting to Java. It will be a lot easier to port 4.12 than 4.10. There was this duplicate line of code that an object's pointer was subtracted from another pointer in order to get its index for a global array. It made me cry. It's gone now, and it won't hurt anyone ever again.
Those kinds of changes can lead to ripple-on effects throughout the codebase, so I'd think that trying a tentative C# port of some subsystems might indicate potential problems.
Rather than doing a super-hacky one-off C#/Unity port, it would be far better to do the needed fixes on the C++ side of things. The entire point of the C#/Unity exercise would be to end up with a truly cross-platform version that can in fact be maintained.
Glad to see someone else thinking ahead.
Basically, the beginning choices would be entirely UI elements on the canvas. We should keep in mind that options should be linked to a button press, but also a mouseclick for when we switch to an android platform. Would it be easier to do certain text and the infiltrations, like the beginning founder backstory, as separate scenes rather than the whole game being one scene? That way you don't have to keep destroying or hiding gameObjects when you don't want to display them. Instead, each screen will load the next scene as soon as you choose an option. It might simplify things a bit.
In theory a multiple scene setup could work, but LCS as written in C++ only has one 'scene'. KISSOM, Keep It Simple, Sir Or Madam.
But trust me, there's a ton of work that would need to be done on the C++ before it's even viable to think about porting it.
ABSOLUTELY TRUE.
Another thing is global variables. You just don't get to have them in C#, you'd need a class with static variables in it. The C++ can be refactored to have that.
All the "extern" shit needs to go as well then.
and there is the use of "char *" raw strings everywhere.
I've done a fair amount of refactoring to reduce the scope of global variables. Each variable is declared exclusively in the file it is used, and the only usage of the externs keyword is within individual functions. It was an enormous pain. I have dreams about "extern". No matter how many I kill, they keep coming.
And char*. My C++ book says not to use char*, and that's all it has to say about that.
Throughout the LCS codebase there are instances of:
string str = ...;
someFunction(str.data(), ...);
someOtherFunction(str.c_str(), ...);
.data() and .c_str() are functions that convert a string to a char*. (.data() and .c_str() are the same function, but they used to be different, so there's controversy in the C++ community about which one to use, but they are mostly interchangeable with modern compilers)
LCS is so tightly connected with char* that many strings have to be converted to char* in order to be used. Much work to be done.