The code generated for the SupportedCommand functions appear to be incomplete. In particular, the functions are not defined which prevents successful linking if they are used. I have successfully written a couple of them, but I have run into a problem. How do you know how many Commands a unit or group implements?
EDIT:
Fixed. The function is exported correctly, but the SupportedCommand files are still not implemented.
New C++ Wrapper Incomplete
Moderators: hoijui, Moderators
Re: New C++ Wrapper Incomplete
i will have a look at this mid next week.
Re: New C++ Wrapper Incomplete
works fine here, in spring master:
if you do not mean that, please give better info what you mean.
Code: Select all
#include "OOAICallback.h"
#include "Unit.h"
#include "CommandDescription.h"
// ...
std::string msgText = "SuportedCommands:";
const std::vector<springai::Unit*> friendlyUnits = callback->GetFriendlyUnits();
if (!friendlyUnits.empty()) {
springai::Unit* unit = friendlyUnits[0];
const std::vector<springai::CommandDescription*> supportedCommands = unit->GetSupportedCommands();
std::vector<springai::CommandDescription*>::const_iterator sci;
for (sci = supportedCommands.begin(); sci != supportedCommands.end(); ++sci) {
msgText = msgText + "\n\t" + (*sci)->GetName();
}
}
callback->GetGame()->SendTextMessage(msgText.c_str(), 0);
Re: New C++ Wrapper Incomplete
I will double check my code on monday or tuesday and get back to you.