44 #define EXIT_SYMBOL 'K'
45 #define EXIT_COLOR COLOR_YELLOW
46 #define FLOOR_SYMBOL '.'
47 #define FLOOR_COLOR COLOR_GREEN
48 #define WALL_SYMBOL '#'
49 #define WALL_COLOR COLOR_CYAN
50 #define COLOR_SHADOW COLOR_BLUE
52 Cell *
initCell(
int x,
int y,
char symbol,
int is_walkable,
int block_light,
int color);
Cell * initCellFloor(int x, int y)
Initializes a new floor cell with the initCell() function.
Definition: cell.c:45
int isCellWalkable(Cell *cell)
Checks if a cell is walkable. returns the cell->is_walkable field.
Definition: cell.c:68
int isCellBlockingLight(Cell *cell)
Checks if a cell is blocking light. returns the cell->block_light field.
Definition: cell.c:78
struct cell Cell
Structure of a cell.
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.
Definition: cell.c:18
void freeCell(void *p)
Frees the memory allocated for a cell by initCell(). Sets all the cell fields to 0.
Definition: cell.c:124
Cell * initCellWall(int x, int y)
Initializes a new wall cell with the initCell() function.
Definition: cell.c:58
int isCellMonster(Cell *cell)
Checks if a cell is has a monster.
Definition: cell.c:98
int isCellItem(Cell *cell)
Checks if a cell is has a item. returns the cell->has_item field.
Definition: cell.c:88
int isCellExit(Cell *cell)
Checks if a cell is the exit cell.
Definition: cell.c:115
Structure of a cell.
Definition: cell.h:27
unsigned int x
Definition: cell.h:29
unsigned int was_visible
Definition: cell.h:33
unsigned int is_visible
Definition: cell.h:34
char symbol
Definition: cell.h:28
unsigned int has_player
Definition: cell.h:37
unsigned int has_item
Definition: cell.h:36
int effect
Definition: cell.h:39
int distance_to_player
Definition: cell.h:35
int color
Definition: cell.h:41
int monster_index
Definition: cell.h:38
int effect_duration
Definition: cell.h:40
unsigned int y
Definition: cell.h:30
unsigned int is_walkable
Definition: cell.h:31
unsigned int block_light
Definition: cell.h:32