1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
#include <iostream>
#include <string>
#include <cstdlib>
#include <time.h>
#include <array>
#include <list>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cassert>
using namespace std;
class LocationHandler;
class ScreenRegion{
protected:
ScreenHandler * m_pScreenHandler;
sf::RenderWindow * m_pWindow;
sf::Font m_Font;
MenuInputHandler * m_pMenuInput;
ActionInputHandler * m_pActionInput;
vector<sf::Text> m_CurrentConfig;
public:
ScreenRegion(ScreenHandler * pScreenHandler, sf::Font& font, sf::RenderWindow * pWindow, MenuInputHandler * pMenuInput, ActionInputHandler * pActionInput):m_pScreenHandler(pScreenHandler), m_Font(font), m_pWindow(pWindow),m_pMenuInput(pMenuInput), m_pActionInput(pActionInput){};
~ScreenRegion(){};
};
class BigScreenRegion : public ScreenRegion{
private:
vector<sf::Vector2i> m_bigScreenPoints;
LocationHandler * m_pLocationHandler;
void homeConfig(){
sf::Text homeTitle;
homeTitle = SetText(homeTitle, sf::String("Home"), m_Font, white, veryLarge, getPosition(0));
m_CurrentConfig.push_back(homeTitle);
}
void localMapConfig();
public:
BigScreenRegion(ScreenHandler * pScreenHandler, sf::Font& font, sf::RenderWindow * pWindow, MenuInputHandler * pMenuInput, ActionInputHandler * pActionInput, LocationHandler * pLocationHandler): ScreenRegion(pScreenHandler, font, pWindow, pMenuInput, pActionInput), m_pLocationHandler(pLocationHandler){
}
~BigScreenRegion(){};
sf::Vector2i getPosition(unsigned short positionID){ return m_bigScreenPoints[positionID]; }
void setConfiguration(){
if (m_pLocationHandler->getCurrentLocalLocation() == "Home"){ ///<----This is line the error refers to //error C2227: left of '->getCurrentLocalLocation' must point
//to class/struct/union/generic type
//Then
//error C2027: Use of undefined type "LocationHandler"
homeConfig();
}
}
void display(){
for (vector<sf::Text>::iterator iter = m_CurrentConfig.begin(); iter != m_CurrentConfig.end(); iter++){
m_pWindow->draw(*iter);
}
}
};
|