#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <malloc.h>
#include "define.h"
Go to the source code of this file.
Data Structures | |
struct | schemaProp |
Data struct containing the schama's properties. More... | |
Typedefs | |
typedef struct schemaProp | schemaGame |
Functions | |
unsigned short int | weight (char cellId) |
Funtion that return the weight of the request object WARNING: An accessible object return weight 1. | |
bool | isaccessible (char cellId) |
Function that check if the request object is accessible. | |
char * | color (char cellId) |
Function that returns a string's pointer that contains the request object's color. | |
char * | colorVisited (unsigned short int cellId) |
Function that returns a string's pointer that contains the request object's color during the game. | |
void | visitCell (unsigned int row, unsigned int col) |
It's used to mark (with colors) the route made in the game: changed if the cell is VISITED from an UNVISITED cell or is VISITED from a cell that was alreay VISITED. | |
Variables | |
schemaGame | schemaData |
Variable of type schemaGame that contains all the schema's properties. |
Definition in file object.h.
typedef struct schemaProp schemaGame |
char* color | ( | char | cellId | ) |
Function that returns a string's pointer that contains the request object's color.
(Used to schema objects)
cellId | Id of the object in input |
Definition at line 55 of file object.c.
References CLOSE, D5, DOOR, FREE, and START.
Referenced by colorVisited(), draw_brush(), and drawschema().
char* colorVisited | ( | unsigned short int | cellId | ) |
Function that returns a string's pointer that contains the request object's color during the game.
(Used to mark cell along a route)
cellId | Id of the object in input |
Definition at line 83 of file object.c.
References color(), D5, FREE, UNVISITED, VISIT1, and VISIT2.
Referenced by drawschema(), and updateSchemaCell().
bool isaccessible | ( | char | cellId | ) |
Function that check if the request object is accessible.
cellId | Id of the object in input |
Definition at line 34 of file object.c.
References CLOSE, D5, DOOR, FREE, and START.
Referenced by checkKeyPressed(), schema_round_search(), and weight().
void visitCell | ( | unsigned int | row, | |
unsigned int | col | |||
) |
It's used to mark (with colors) the route made in the game: changed if the cell is VISITED from an UNVISITED cell or is VISITED from a cell that was alreay VISITED.
An eventually unknow value set the cell to UNVISITED.
row | Cell row position | |
col | Cell column position |
Definition at line 109 of file object.c.
References D1, D5, schemaProp::numCol, schemaProp::numRow, schemaData, UNVISITED, VISIT1, VISIT2, and schemaProp::visitedCellInfo.
Referenced by updateSchemaCell().
unsigned short int weight | ( | char | cellId | ) |
Funtion that return the weight of the request object WARNING: An accessible object return weight 1.
cellId | Id of the object in input |
Definition at line 10 of file object.c.
References CLOSE, D5, DOOR, FREE, isaccessible(), and START.
Referenced by drawingAndSetSchemaInfo(), new_tournament(), and updateSchemaCell().
Variable of type schemaGame that contains all the schema's properties.
Definition at line 45 of file object.h.
Referenced by bestroute(), bestroute_check_in_data(), checkDoorStartPoint(), checkKeyPressed(), checkRowColValues(), drawingAndSetSchemaInfo(), drawschema(), getdoors(), keypressed(), loadCheckGame(), new_tournament(), newgame(), printschema(), schema_round_search(), setSchemaDataStructures(), updateSchemaCell(), and visitCell().