Snoke
common.cpp File Reference

shared functions realisation More...

#include "common.h"
Include dependency graph for common.cpp:

Go to the source code of this file.

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 set_escdelay (short delay)
 
void sleepHandler ()
 setting new values for sleep function on signal interrupt More...
 
void addSleep ()
 For unix-based systems interrupted sleep must be continued. More...
 
Point getConsoleSize ()
 Gets size of current console screen in symdols. More...
 

Detailed Description

shared functions realisation

Author
Yegor Ignatov
Version
0.1
Date
2019-05-03

Definition in file common.cpp.

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  delay)

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: