jubilant-funicular
Screen.cpp
1 #include "nta/Screen.h"
2 #include "nta/InputManager.h"
3 #include "nta/WindowManager.h"
4 #include "nta/ScreenManager.h"
5 #include "nta/ResourceManager.h"
6 #include "nta/Logger.h"
7 
8 namespace nta {
9  Screen::Screen(crstring name) : m_name(name) {
10  }
11  Screen::~Screen() {
12  }
13  const InputManager& Screen::getInput() const {
14  return m_manager->getInput();
15  }
16  ScreenState Screen::getState() const {
17  return m_state;
18  }
19  std::string Screen::getName() const {
20  return m_name;
21  }
22  int Screen::getEscIndex() const {
23  return m_escIndex;
24  }
25  int Screen::getXIndex() const {
26  return m_xIndex;
27  }
28  int Screen::getIndex() const {
29  return m_index;
30  }
31  int Screen::getNextIndex() const {
32  return m_nextIndex;
33  }
34  void* Screen::getSwitchData() const {
35  return m_switchData;
36  }
38  m_manager = manager;
39  }
40  void Screen::setIndices(int index, int escIndex, int xIndex, SetIndicesKey key) {
41  m_index = index;
42  m_escIndex = escIndex;
43  m_xIndex = xIndex;
44  }
45  void Screen::setWindow(crstring title, SetWindowKey key) {
47  }
49  m_state = ScreenState::RUNNING;
50  }
52  }
53 }
nta::Screen::getName
std::string getName() const
gets name of screen
Definition: Screen.cpp:19
nta::Screen::m_window
Window * m_window
the Window this Screen appears on
Definition: Screen.h:63
nta::Screen::setManager
void setManager(ScreenManager *manager, SetManagerKey key)
Sets the manager of this screen.
Definition: Screen.cpp:37
nta::Screen::setWindow
void setWindow(crstring title, SetWindowKey key)
sets the window to associate with this screen
Definition: Screen.cpp:45
nta::SetManagerKey
Key unlocking the setManager() "private" function of class Screen.
Definition: Screen.h:12
nta::ScreenSwitchInfo
Info passed to Screen::onFocus.
Definition: Screen.h:33
nta::Screen::setIndices
void setIndices(int index, int escIndex, int xIndex, SetIndicesKey key)
sets various screen indices
Definition: Screen.cpp:40
nta::Screen::offFocus
virtual void offFocus()
called when the screen is no longer active
Definition: Screen.cpp:51
nta::Screen::m_state
ScreenState m_state
the state of this screen
Definition: Screen.h:59
nta::Screen::Screen
Screen(crstring name="UNAMED_SCREEN")
basic constructor and destructor
Definition: Screen.cpp:9
nta::Screen::m_name
std::string m_name
the name of the Screen
Definition: Screen.h:65
nta::Screen::m_manager
ScreenManager * m_manager
the ScreenManager that owns this screen
Definition: Screen.h:61
nta::Screen::onFocus
virtual void onFocus(const ScreenSwitchInfo &info)
called when the screen becomes active
Definition: Screen.cpp:48
nta::ScreenManager::getInput
const InputManager & getInput() const
returns the InputManager
Definition: ScreenManager.h:47
nta::Screen::m_switchData
void * m_switchData
data to pass to the new screen (via onFocus) when m_state == SWITCH
Definition: Screen.h:69
nta::Screen::m_nextIndex
int m_nextIndex
the index of the screen to go to when m_state == SWITCH
Definition: Screen.h:67
nta::Screen::m_index
int m_index
the index of this screen in its container
Definition: Screen.h:50
nta::Screen::getState
ScreenState getState() const
returns state of screen
Definition: Screen.cpp:16
nta
Definition: Animation2D.h:6
nta::SetWindowKey
Key unlocking the setWindow() "private" function of class Screen.
Definition: Screen.h:26
nta::ScreenManager
Definition: ScreenManager.h:16
nta::Screen::m_escIndex
int m_escIndex
the index of the screen to go to when the Esc key is pressed
Definition: Screen.h:52
nta::SetIndicesKey
Key unlocking the setIndices() "private" function of class Screen.
Definition: Screen.h:19
nta::Screen::getSwitchData
void * getSwitchData() const
gets the switch data (shoudl this require a key?)
Definition: Screen.cpp:34
nta::WindowManager::getWindow
static Window * getWindow(crstring windowTitle, int width=640, int height=480, int flags=0)
Gets a Window with specified title, width, height, and flags.
Definition: WindowManager.cpp:6
nta::Screen::m_xIndex
int m_xIndex
the index of the screen to go to when the window's X button is pressed
Definition: Screen.h:54
nta::Screen::getEscIndex
int getEscIndex() const
gets various screen indices
Definition: Screen.cpp:22