I've written an AI to play a game in Objective-C on Mac. The AI bits are mostly C++ code for performance. I want to make the AI cross platform because the game has a huge windows user base. My hope is to get other programmers interested in helping out because it is very time consuming to make perfect screen detection and AI decisions.

My question is, to write the Mac and Windows specific code in their respective languages(C# and Obj-C) for UI, screen capture and input simulation; can I have that code be usable from D? I don't know much about shared libraries or importing DLLs so I have no knowledge on the possibility. I would like to write all the AI code in D but have all the OS specific code written in their own languages that I can call from D. I am very familiar with writing C#, Obj-C and even D code. I just don't know how to make them all play nice. Maybe there's a way to compile the OS specific code in libraries and D can call them depending on which OS the D code gets compiled to?

Would anyone know how to do this? Or have basic examples?
To start I'd just like to write a D program that can call some specific already compiled C# or Obj-C code that will create a UI window but maintain full control in D such that D could issue further already compiled commands. Also receive input, like a button is clicked and that button sends an event notifier back to D.

Is this plausible?

Reply via email to