Hi,
As you might now I am currently creating a wrapper for the Esenthel Engine. But I have problems in wrapping the method setObjType of the EE::Game::WorldManager.
The problem is that EE::Game::Obj is an abstract class, so it can't be instantiated (it's needed that the class is non abstract for the ObjMemx container I think). Here is the code:
Code:
EsenthelNet::WorldManager^ SetObjType(System::Collections::Generic::List<EsenthelNet::Obj^>^ container, int objType) {
//Get unmanaged container for objects
EE::Game::ObjMemx<EE::Game::Obj> cont;
Game::World.setObjType(cont, objType);
//Create the managed container
container = gcnew System::Collections::Generic::List<EsenthelNet::Obj^>();
//Add the unmanaged objects to the managed container
int elms = cont.elms();
for(int i = 0; i < elms; i++) {
container->Add(gcnew EsenthelNet::Obj(&cont[i]));
}
return this;
}
Perhaps the solution is simple, but I can't figure it out at the moment, so I wanted to ask you.
In the method the unmanaged EE::Game::Obj is filled into a managed .Net List of managed EsenthelNet::Obj's.
As you might have notived, I haven't wrapped the EE containers. It's because imho the .Net List is much more comfortable to use, than five different types of containers. But maybe I'll change this in future...
Any help is greatly appreciated!
best regards,
Kevin