-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathState.cpp
53 lines (44 loc) · 973 Bytes
/
State.cpp
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
#include "State.h"
State::State(RenderWindow* window, map <string, int>* supportedkeys,stack<State*>* states)
{
this->states = states;
this->supportedkeys = supportedkeys;
this->window=window;
this->quit = false;
this->paused = false;
}
State::~State()
{
}
const bool& State::getquit() const
{
return quit;
}
// void State::checkstate()
// {
// if(Keyboard::isKeyPressed(Keyboard::Key(this->keybinds.at("Close"))))
// {
// this->quit = true;
// }
// }
void State::updatemousepos()
{
this->mouseposscreen = Mouse::getPosition();
this->mouseposwindow = Mouse::getPosition(*this->window);
this->mouseposview = this->window->mapPixelToCoords(this->mouseposwindow);
system ("cls");
cout << "Mouse pos: " << this->mouseposview.x << " " << this->mouseposview.y << endl;
}
void State::pausestate()
{
this->paused = true;
}
void State::unpausedstate()
{
this->paused = false;
}
void State::endState()
{
cout << "End state" << endl;
this->quit = true;
}