nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
Layout Class Reference

Interface for how the things are shown on the screen. More...

#include <Layout.hpp>

Inheritance diagram for Layout:
Collaboration diagram for Layout:

Public Member Functions

 Layout (int width, int height)
 
virtual void windowsInit ()
 
virtual void windowsExit ()
 
virtual void draw ()
 

Public Attributes

Windowmain
 Layout's main Window, where all the others are inside.
 

Static Public Attributes

static int screenWidth = 0
 Full width of the terminal right now.
 
static int screenHeight = 0
 Full height of the terminal right now.
 

Detailed Description

Interface for how the things are shown on the screen.

Any Layout will have lots if Windows, each with a specific function: to show the game board, display high scores, show next pieces, and such.

I suggest you subclass this and implement your layout elsewhere.

Definition at line 15 of file Layout.hpp.

Constructor & Destructor Documentation

◆ Layout()

Layout::Layout ( int width,
int height )

Definition at line 15 of file Layout.cpp.

◆ ~Layout()

Layout::~Layout ( )
virtual

Definition at line 21 of file Layout.cpp.

Member Function Documentation

◆ draw()

void Layout::draw ( )
virtual

Definition at line 77 of file Layout.cpp.

◆ windowsExit()

void Layout::windowsExit ( )
virtual

Definition at line 73 of file Layout.cpp.

◆ windowsInit()

void Layout::windowsInit ( )
virtual

Definition at line 23 of file Layout.cpp.

Member Data Documentation

◆ main

Window* Layout::main

Layout's main Window, where all the others are inside.

Definition at line 33 of file Layout.hpp.

◆ screenHeight

int Layout::screenHeight = 0
static

Full height of the terminal right now.

Definition at line 22 of file Layout.hpp.

◆ screenWidth

int Layout::screenWidth = 0
static

Full width of the terminal right now.

Definition at line 19 of file Layout.hpp.


The documentation for this class was generated from the following files: