Snoke
common.h File Reference

shared functions prototypes, structures, main classes declarations More...

#include <iostream>
#include <ncurses.h>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PointStyle
 Style of the cell in console window. More...
 
class  Point
 Coordinates and style of the cell in console window. More...
 

Functions

std::ostream & operator<< (std::ostream &s, Point p)
 Operation '<<' override for the Point class. More...
 
void mSleep (int time)
 Cross-platform sleep function cover. More...
 
void addSleep ()
 For unix-based systems interrupted sleep must be continued. More...
 
Point getConsoleSize ()
 Gets size of current console screen in symdols. More...
 
void sleepHandler ()
 setting new values for sleep function on signal interrupt More...
 
void set_escdelay (short mode)
 

Variables

const int MAXLINE = 256
 

Detailed Description

shared functions prototypes, structures, main classes declarations

Author
Yegor Ignatov
Version
0.1
Date
2019-05-03

Definition in file common.h.

Function Documentation

void addSleep ( )

For unix-based systems interrupted sleep must be continued.

Definition at line 90 of file common.cpp.

Here is the caller graph for this function:

Point getConsoleSize ( )

Gets size of current console screen in symdols.

Definition at line 100 of file common.cpp.

Here is the caller graph for this function:

void mSleep ( int  time)

Cross-platform sleep function cover.

Parameters
time- time the game will 'freeze' for in milliseconds

Definition at line 49 of file common.cpp.

Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  s,
Point  p 
)

Operation '<<' override for the Point class.

Parameters
s- current ostream variable
p- a Point to print This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 30 of file common.cpp.

void set_escdelay ( short  mode)

Plug for ncurses unix set_escdelay function In Windows does nothing, needs for supporting crossplatform code

Parameters
{short}delay - time to wait before process ESC key press

Definition at line 71 of file common.cpp.

void sleepHandler ( )

setting new values for sleep function on signal interrupt

Definition at line 78 of file common.cpp.

Here is the caller graph for this function:

Variable Documentation

const int MAXLINE = 256

Definition at line 28 of file common.h.