|
Snoke
|
class for containing and displaying the game field More...
#include <labyrinth.h>

Public Member Functions | |
| bool | setLabyrinth (Point dimensions) |
| Sets the default values fro the variables as well as generating the labyritnh array with borders. More... | |
| bool | addSnake (Snake *snake) |
| Adding snake to the laburinth and getting the host snake(firest added snake) More... | |
| bool | addPoint (Point p) |
| Adding Point to the labyrinth with the check of correction. More... | |
| bool | rmPoint (Point p) |
| Remove Point from the labyrinth. More... | |
| void | displayHandler (int displayMethod=-1) |
| A method which decides what dispaly method will be used in each situation. More... | |
| bool | initBall () |
| Ball initialization with labyrinth updating. More... | |
| bool | generateBall () |
| Generate the Ball. More... | |
| short | isFree (Point p) |
| Mark of if the asked Point is free. More... | |
| bool | save (char name[MAXLINE]) |
| Method to save labyritnh(borders and obstacles, defined in reserved string) to the file. More... | |
| bool | load (char name[MAXLINE]) |
| Mehod to load labyrinth from the file. More... | |
Public Attributes | |
| Change | change |
| Ball | ball |
Private Member Functions | |
| void | updateLabyrinth () |
| Updating the labyrinth(changing the values of some Points) More... | |
| void | sizeHandler () |
| A method, which sets start and end values depending on the position of local_player's snake head and current console size. More... | |
Private Attributes | |
| char ** | labyrinth |
| std::string | reserved = "!" |
| Snake * | snake = NULL |
| Point | start |
| Point | end |
| Point | prevStart |
| Point | prevEnd |
| Point | gameFieldSize |
| DisplayHandler | dispHandler |
Friends | |
| class | DisplayHandler |
class for containing and displaying the game field
| labyrinth | - game field, consisting of chars |
| reserved | - array of reserved chars for inside usage |
| prevDisplayMethod | - value, containing the makr of which display method was previously called(is used in displaying) |
| snake | - pointer to a local_player's snake |
| start | - top left corner from which the drawing of the current cycle starts |
| end | - bottom right corner at which the drawing of the current cycle ends |
| prevStart | - previous value of start |
| prevEnd | - previous value of end |
Definition at line 66 of file labyrinth.h.
| bool Labyrinth::addPoint | ( | Point | p | ) |
Adding Point to the labyrinth with the check of correction.
| p | - point to add to the labyrinth |
Definition at line 271 of file labyrinth.cpp.


| bool Labyrinth::addSnake | ( | Snake * | aSnake | ) |
Adding snake to the laburinth and getting the host snake(firest added snake)
| aSnake | - a snake to add |
Definition at line 110 of file labyrinth.cpp.


| void Labyrinth::displayHandler | ( | int | displayMethod = -1 | ) |
A method which decides what dispaly method will be used in each situation.
| displayMethod | - force it to use a certain display method |
Definition at line 152 of file labyrinth.cpp.


| bool Labyrinth::generateBall | ( | ) |
Generate the Ball.
| labyrinth | - the current state of the labyrinth object for intersection checking |
Definition at line 83 of file labyrinth.cpp.


| bool Labyrinth::initBall | ( | ) |
Ball initialization with labyrinth updating.
Definition at line 71 of file labyrinth.cpp.


| short Labyrinth::isFree | ( | Point | p | ) |
Mark of if the asked Point is free.
| p | - Point to check in the labyrinth |
Definition at line 254 of file labyrinth.cpp.

| bool Labyrinth::load | ( | char | name[MAXLINE] | ) |
Mehod to load labyrinth from the file.
| name | - name of the file to read from |
Definition at line 339 of file labyrinth.cpp.

| bool Labyrinth::rmPoint | ( | Point | p | ) |
Remove Point from the labyrinth.
| p | - point to remove from the labyrinth |
Definition at line 286 of file labyrinth.cpp.

| bool Labyrinth::save | ( | char | name[MAXLINE] | ) |
Method to save labyritnh(borders and obstacles, defined in reserved string) to the file.
| name | - name of the file, where to sace the labyrinth |
Definition at line 297 of file labyrinth.cpp.

| bool Labyrinth::setLabyrinth | ( | Point | fieldSize | ) |
Sets the default values fro the variables as well as generating the labyritnh array with borders.
| gameFieldSize | - a size of the labyrinth |
Definition at line 17 of file labyrinth.cpp.


|
private |
A method, which sets start and end values depending on the position of local_player's snake head and current console size.
Definition at line 171 of file labyrinth.cpp.


|
private |
Updating the labyrinth(changing the values of some Points)
Definition at line 232 of file labyrinth.cpp.


|
friend |
Definition at line 77 of file labyrinth.h.
| Ball Labyrinth::ball |
Definition at line 83 of file labyrinth.h.
| Change Labyrinth::change |
Definition at line 82 of file labyrinth.h.
|
private |
Definition at line 78 of file labyrinth.h.
|
private |
Definition at line 73 of file labyrinth.h.
|
private |
Definition at line 76 of file labyrinth.h.
|
private |
Definition at line 69 of file labyrinth.h.
|
private |
Definition at line 75 of file labyrinth.h.
|
private |
Definition at line 74 of file labyrinth.h.
|
private |
Definition at line 70 of file labyrinth.h.
|
private |
Definition at line 71 of file labyrinth.h.
|
private |
Definition at line 72 of file labyrinth.h.