Good question. This is a port to C# of the original C code for Jagged Alliance 2: Gold which is hosted at: https://github.com/historicalsource/jaggedalliance2
Not yet, not for awhile. If you're wanting to play a ported JA2, check out: https://ja2-stracciatella.github.io/
It is not! The original C code is well written C code. Since this port is almost a line by line conversion of C to C#, at the beginning, some nasty patterns are being used to speed up the port (mainly to help with Find/Replace).
For example, C has a ton of globals, C# rarely has a lot of 'globals' (static). To avoid rewriting as lines are converted, I just throw globals into the Globals.cs file and move on.
Once the porting is done, then an effort to convert to idiomatic C# will start.
-
When JA2 was written, memory was critical to manage. Now? Doesn't matter as much for the level we're talking about. So, when possible, turning all numbers into
int
. -
Naming conventions:
-
C enums are often named
LIKE_THIS_VALUE
, to help with find/replace, I create a C# enum calledLIKE_THIS
and then find/replaceLIKE_THIS_
toLIKE_THIS.
-
All standard C# naming conventions are ignored for the time being.
-
Almost all pointers are just treated as the original type and nullable. Sometimes they get an
out
or aref
. -
Linked lists and arrays in the C code are usually converted to
List<T>
cuts out a lot of scaffolding code.
Nothing, if you don't own the game, you won't be able to use this to get around purchasing it, this still needs all the assets from the original game. It's often only $3 bucks or on GoG or Steam, so pay for it.
using static SharpAlliance.Core.Globals;