#ifndef HEADER_OBJECT
#define HEADER_OBJECT

/**
 * @file 
 * File containing the interface of object module
 */
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#include <malloc.h>
#include "define.h"

/* Start interface of object module */

/** Data struct containing the schama's properties*/
struct schemaProp{
    /** Matrix that represent the schema, in which each cell 
        contains a character to identify its the type.*/
    char **gameMap;
    
    /** Number of rows of the schema*/                 
    unsigned int numRow; 

    /** Number of colums of the schema*/                   
    unsigned int numCol;                    

    /** Number of row of the start point*/
    unsigned int startRow;                  

    /** Number of column of the start point*/
    unsigned int startCol;                  

    /** Matrix that contains the visit info of each cell during a game.*/
    unsigned short int **visitedCellInfo;   
};


/* Definition of the type schemaGame.*/
typedef struct schemaProp schemaGame;


/** Variable of type schemaGame that contains all the schema's properties.*/
schemaGame schemaData;


/** Funtion that return the weight of the request object
 *  WARNING: An accessible object return weight 1
 *  @return Weight of the object (unsigned short int).
*/
unsigned short int weight(char cellId /**< Id of the object in input*/
                        );


/** Function that check if the request object is accessible 
  * @return Positive value (true) if the object is accessible.
            Negative value (false) otherwise.
*/
bool isaccessible( char cellId /**< Id of the object in input*/
                 );

/** Function that returns a string's pointer that contains the request
    object's color. (Used to schema objects)
    @return Object color (char *).
*/
char *color( char cellId  /**< Id of the object in input*/
           );

/** Function that returns a string's pointer that contains the request
    object's color during the game. (Used to mark cell along a route)
    @return Object color during the game (char *).
*/
char *colorVisited( unsigned short int cellId /**< Id of the object in input*/
                  );

/** 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.
*/
void visitCell( unsigned int row, /**< Cell row position*/
                unsigned int col  /**< Cell column position*/
              );

/* End interface of object module */

#endif
