I've (hopefully) created a vector of objects (Trolls in a rougelike). Each object should have an x and y coordinate set.
I'm attempting to see if I've actually populated the vector correctly and I can get the correct size of the vector but when I try to return the coords for individual objects within the array I get the following error:
1 2 3 4
C:\...\PlayGame.cpp||In member function 'void PlayGame::checkTrolls(std::vector<Troll>)':|
C:\...\PlayGame.cpp|63|error: cannot convert 'Troll::getTrollX' from type 'int (Troll::)()' to type 'int'|
C:\...\PlayGame.cpp|64|error: cannot convert 'Troll::getTrollY' from type 'int (Troll::)()' to type 'int'|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
#include "Troll.h"
Troll::Troll() {
}
int Troll::getTrollX() {
return _trollX;
}
int Troll::getTrollY() {
return _trollY;
}
void Troll::setTrollXY(int x, int y) {
_trollX = x;
_trollY = y;
}
Sorry for the sprawl. Any help would be much appreciated.
Also, does anyone know why the fprum preview button shows no text apart from the username and date at the top? I use the Chrome browser and I've disabled pop up blocking for this domain.