Thursday, February 25, 2010

Recently I spotted question if it's possible to create robot in C++. Here is the answer. Ok, I know, it's not like real C++ with pointers etc, this is managed version of C++, which is safe enough to be runnable in Robocode.

Download VS 2008 Express C++

Create new CLR-> Class Library (DLL) project

Go to project properties, Common Properties, Add New Reference, and add robocode.dll from lib folder of your robocode installation.

Go to project properties, Configuration properties, General, Common Language Runtime support and set it to Safe MSIL (/clrsafe)

Go to AssemblyInfo.cpp and delete line with [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

Saturday, February 13, 2010

support for delegates and events

.NET events and delegates are supported by proxygen and runtime. From Java side they could be invoked with Invoke() method which has proper signature. Delegates could be also implemented on Java side, by usual anonymous class and passed back to CLR. So Java could subscribe to .NET events.