I'm getting the following error:
1>ExampleAIModule.obj : error LNK2001: unresolved external symbol "public: int __thiscall ExampleAIModule::getTop(class BWTA::Polygon)" (?getTop@ExampleAIModule@@QAEHVPolygon@BWTA@@@Z)
for the following method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/**
* Method: getTop
* Takes a polygon and returns the lowest y value it touches
*/
int getTop(BWTA::Polygon subject) {
// Note: the lower y values are "higher" on the map
int top = mapHeight - 1;
for(BWTA::Polygon::const_iterator i = subject.begin();
i != subject.end(); i++) {
if((*i).y() < top)
top = (*i).y();
}
return top;
}
Another idea: is the code you have above copied from inside the definition of the class ExampleAIModule, or is it in a cpp file?
If it is in a separate cpp file then you need to do this: int ExampleAIModule::getTop(BWTA::Polygon subject) {
(etc)
since the getTop function is supposed to be a class member, I assume.