View Single Post
Old April 9, 2015, 13:56   #1
Dean Anderson
Join Date: Nov 2009
Posts: 149
Dean Anderson is on a distinguished road
C#, Angband and Unity

I've been looking around and Googling, and I'm surprised at the lack of Angband ports to C# or Java or other languages. There's a half-finished C# port on Google Code, and I've found a few discussions about Java ports but nothing substantial.

So I'm currently working on an experimental C# port of the Cthangband code myself.

What I'm basically doing is this:

1) Take a snapshot of the Cthangband 5.0.0 code (I've done this - it's a simple copy/paste operation!).

2) Strip out all the horrible hacks that make it work on multiple platforms - all the #ifdef business - so we have a simpler codebase which contains only the code that's actually compiled into the Windows Console version. (I've done that, and it compiles and works as normal.)

3) Port the code from C to C#, as-is. (I'm in the process of doing this. Obviously I can't keep it completely as-is, since the file handling, memory management and console code are rather different in C# to C, but I've completed those "tricky" bits now.)

4) Once I have a working C# port, refactor the code to make it properly object oriented. (I'm trying to avoid any of this until I've got the basic port in #3 working, but I'm having to do little bits in order to get the terminal stuff to work - for example instead of using a load of function hooks, the 'term' functions are now in an abstract class which is inherited by the specific 'ConsoleTerm' class containing the Console implementation of a term.)

5) Once I have a fully object oriented C# version of Cthangband running, I want to swap out the Console display for something flashier. I was thinking that Unity would be good because it's nicely portable and handles C# code natively.
Dean Anderson is offline   Reply With Quote