Snoke
Main Page
Related Pages
Classes
Files
File List
File Members
Game_run.h
Go to the documentation of this file.
1
#ifndef GAME_RUN_H
2
#define GAME_RUN_H
3
4
#include "
shared.h
"
5
#include "
Game/game.h
"
6
7
TEST
(Game_run, test1)
8
{
9
/*
10
* Block initializing ncurses console in the current console window,
11
* and setting some parameters
12
*/
13
initscr();
14
start_color();
15
noecho();
16
nodelay(stdscr,
true
);
17
curs_set(0);
18
keypad(stdscr,
true
);
19
20
Game
game;
21
int
size = 100;
22
int
speed = 150;
23
int
cycles = 5;
24
bool
retVal = game.
init
(size, speed, cycles);
25
if
(!retVal)
26
{
27
FAIL();
28
}
29
30
retVal = game.
run
();
31
endwin();
32
if
(retVal)
33
{
34
FAIL();
35
}
36
else
37
{
38
SUCCEED();
39
}
40
}
41
42
#endif // GAME_RUN_H
Game::init
bool init(int size=20, int sp=100, int loops=-1)
Initializes game.
Definition:
game.cpp:38
game.h
Definitions and prototypes for Game class.
Game::run
int run()
Main game loop.
Definition:
game.cpp:68
shared.h
shared functions for testing
Game
Main game class.
Definition:
game.h:30
TEST
TEST(Game_run, test1)
Definition:
Game_run.h:7
tests
Game_run.h
Generated by
1.8.11