|
LI2 Roguelite
|

Functions | |
| Cell * | initCell (int x, int y, char symbol, int is_walkable, int block_light, int color) |
| Initializes a new cell. Allocates memory for a new cell and initializes its fields. More... | |
| Cell * | initCellFloor (int x, int y) |
| Initializes a new floor cell with the initCell() function. More... | |
| Cell * | initCellWall (int x, int y) |
| Initializes a new wall cell with the initCell() function. More... | |
| int | isCellWalkable (Cell *cell) |
| Checks if a cell is walkable. returns the cell->is_walkable field. More... | |
| int | isCellBlockingLight (Cell *cell) |
| Checks if a cell is blocking light. returns the cell->block_light field. More... | |
| int | isCellItem (Cell *cell) |
| Checks if a cell is has a item. returns the cell->has_item field. More... | |
| int | isCellMonster (Cell *cell) |
| Checks if a cell is has a monster. More... | |
| int | isCellExit (Cell *cell) |
| Checks if a cell is the exit cell. More... | |
| void | freeCell (void *p) |
| Frees the memory allocated for a cell by initCell(). Sets all the cell fields to 0. More... | |
| void freeCell | ( | void * | p | ) |
Frees the memory allocated for a cell by initCell(). Sets all the cell fields to 0.
| p | Cell to free |
| Cell* initCell | ( | int | x, |
| int | y, | ||
| char | symbol, | ||
| int | is_walkable, | ||
| int | block_light, | ||
| int | color | ||
| ) |
Initializes a new cell. Allocates memory for a new cell and initializes its fields.
| x | Cell x coordinate |
| y | Cell y coordinate |
| symbol | Cell symbol |
| is_walkable | Is the cell walkable? |
| block_light | Is the cell blocking light? |
| color | Cell color |
| Cell* initCellFloor | ( | int | x, |
| int | y | ||
| ) |
Initializes a new floor cell with the initCell() function.
A floor cell is walkable, doesn't block light and has a grey color.
| x | Cell x coordinate |
| y | Cell y coordinate |
| Cell* initCellWall | ( | int | x, |
| int | y | ||
| ) |
Initializes a new wall cell with the initCell() function.
A wall cell is not walkable, blocks light and has a black color.
| x | Cell x coordinate |
| y | Cell y coordinate |
| int isCellBlockingLight | ( | Cell * | cell | ) |
Checks if a cell is blocking light. returns the cell->block_light field.
| cell | Cell to check |
| int isCellExit | ( | Cell * | cell | ) |
Checks if a cell is the exit cell.
| cell | Cell to check |
| int isCellItem | ( | Cell * | cell | ) |
Checks if a cell is has a item. returns the cell->has_item field.
| cell | Cell to check |
| int isCellMonster | ( | Cell * | cell | ) |
Checks if a cell is has a monster.
| cell | Cell to check |
| int isCellWalkable | ( | Cell * | cell | ) |
Checks if a cell is walkable. returns the cell->is_walkable field.
| cell | Cell to check |