I'm trying to abstract away the Image and ImageList classes, and I'm forced to ask myself:
What are images doing in the core of the game? It's not like it can display them, or even manipulate them – they are part of the UI, and that's the only part of the application where they have anything to do!
Well, it appears that Space Trader didn’t run on Linux. Once I looked inside, it was obvious why: I forced it to use a Windows-like Look-and-Feel, which is only available under JVMs for windows. this took about a minute to fix, but that’s when things really started not to work.
All sorts of things happen when saving values to file: Sometimes you want to save a value representing an enum, and sometimes you want to save the real thing. And sometimes you have arrays of whatever that is... C# makes it easy: enums are the numbers that represent them.
This is a helper class, that would help us deal with persistence of enums in Java.
See this post for more.
Winforms over Java1! Not as freaky as you might think. We basically just employ the Adapter design pattern in a larger scale.
With any luck, we now have no compilation problems. Two tasks remain before we can move on: fixing the @ThisWasAProperty fields, and changing the Main() method into something Java likes. The second task is trivial. But how do you encapsulate a few hundred fields, without manually going over each of them?
The first problem we have when trying to run a C# program in Java is that the files won’t compile. While the core syntax is practically the same, some minor sections of it are different – mostly namespace declarations and properties.