Cant see what i'm doing wrong ...
my GameWindow.h has code -
#include <iostream>
#include <string>
using namespace::std;
class GameWindow{
string WindowType;
string WindowName;
int TopLeftX,TopLeftY;
int Height,Width;
bool GetBoxed;
public:
GameWindow(string WinType, string WinName,int TLX,int TLY,int y,int x,bool box);
void SetHeight(int y);
void SetWidth(int x);
void SetTopLeftY(int TLY);
void SetTopLeftX(int TLY);
};
And the source file code being -
#include "GameWindow.h"
GameWindow::GameWindow(string WinType, string WinName,int TLX,int TLY,int y,int x,bool box){
WindowType = WinType; WindowName = WinName;
TopLeftX = TLX; TopLeftY = TLY;
Height = y; Width = x;
GetBoxed = box;
};
void GameWindow::SetHeight(int y){Height = y;}
void GameWindow::SetWidth(int x){Width = x;}
void GameWindow::SetTopLeftY(int TLY){TopLeftY=TLY;}
void GameWindow::SetTopLeftX(int TLX){TopLeftX=TLX;}
so then in another source file i attempt to create a vector of GameSpace and call the constructor each time i add one to the vector -
int OffsetX =5;
vector<GameWindow>GameSpace;
GameSpace.resize(8);
GameSpace[0] = GameWindow("MonstersLeftWin", "Misc",
(getmaxx(stdscr)-22-OffsetX), 2, 1, 22, true);
i get the "no matching constructor for initialisation of GameWindow" error. Cant see what im doing wrong at all!
i also get the error if i have -
GameSpace[0] = *new GameWindow("MonstersLeftWin", "Misc",
(getmaxx(stdscr)-22-OffsetX), 2, 1, 22, true);
still unsure if i need the "new" there or not.
Thanks for the help.