ms_cell.h is done
This commit is contained in:
parent
16732fd116
commit
3eb8dc8f15
1 changed files with 18 additions and 11 deletions
29
ms_cell.h
29
ms_cell.h
|
|
@ -14,10 +14,16 @@
|
|||
#ifndef ___MS_CELL_H
|
||||
#define ___MS_CELL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "general.h"
|
||||
|
||||
/* Note: The 'CellMarker' enumeration is declared in 'general.h'
|
||||
to enable mapping between enum and presentation in 'ms_ui_utils' */
|
||||
|
||||
/** Declares type for a single 'Mine Sweeper' cell */
|
||||
typedef struct MsCellData* MsCell;
|
||||
|
||||
/**
|
||||
* Provides another, yet unused instance, initialized Mine Sweeper cell
|
||||
|
|
@ -28,13 +34,13 @@
|
|||
*
|
||||
* @return The fresh cell instance or 0, if no more instance is available.
|
||||
*/
|
||||
<type> msc_produce_cell();
|
||||
MsCell msc_produce_cell();
|
||||
|
||||
/**
|
||||
* Resets the internal cell factory. Function `msc_produce_cell` is capable
|
||||
* to produce the full number of cell after this function is called.
|
||||
*/
|
||||
<type> msc_reset_cell_factory();
|
||||
void msc_reset_cell_factory();
|
||||
|
||||
/**
|
||||
* Determines whether or not the given cell is valid.
|
||||
|
|
@ -44,7 +50,7 @@
|
|||
* @param cell The cell instance in focus.
|
||||
* @return True if the given cell is valid, false otherwise.
|
||||
*/
|
||||
<type> msc_is_valid(<params>);
|
||||
bool msc_is_valid(MsCell cell);
|
||||
|
||||
/**
|
||||
* Determines whether or not the given cell is currently covered.
|
||||
|
|
@ -52,7 +58,7 @@
|
|||
* @param cell The cell instance in focus.
|
||||
* @return True if the given cell is covered, false otherwise.
|
||||
*/
|
||||
<type> msc_is_covered(<params>);
|
||||
bool msc_is_covered(MsCell cell);
|
||||
|
||||
/**
|
||||
* Uncovers the given cell.
|
||||
|
|
@ -63,8 +69,9 @@
|
|||
* Note: an uncovered cell cannot be covered again.
|
||||
*
|
||||
* @param cell The cell instance in focus.
|
||||
* @return True if the cell was successfully uncovered, false otherwise.
|
||||
*/
|
||||
<type> msc_uncover(<params>);
|
||||
bool msc_uncover(MsCell cell);
|
||||
|
||||
/**
|
||||
* Determines whether or not the given cell carries a mine.
|
||||
|
|
@ -72,7 +79,7 @@
|
|||
* @param cell The cell instance in focus.
|
||||
* @return True if the cell carries a mine, false otherwise.
|
||||
*/
|
||||
<type> msc_has_mine(<params>);
|
||||
bool msc_has_mine(MsCell cell);
|
||||
|
||||
/**
|
||||
* Specifies that the given cell carries a mine.
|
||||
|
|
@ -80,7 +87,7 @@
|
|||
*
|
||||
* @param cell The cell instance in focus.
|
||||
*/
|
||||
<type> msc_drop_mine(<params>);
|
||||
void msc_drop_mine(MsCell cell);
|
||||
|
||||
/**
|
||||
* Provides the number of direct neighbor cells, which carries a mine.
|
||||
|
|
@ -89,7 +96,7 @@
|
|||
* @return The number between 0 to 8 that encounters the neighbor cells
|
||||
* that carries a mine or 255 if the cell is not valid.
|
||||
*/
|
||||
<type> msc_get_dangerous_neighbor_count(<params>);
|
||||
Byte msc_get_dangerous_neighbor_count(MsCell cell);
|
||||
|
||||
/**
|
||||
* Increments (+1) the count of neighbor cells that carries a mine.
|
||||
|
|
@ -97,7 +104,7 @@
|
|||
*
|
||||
* @param cell The cell instance in focus.
|
||||
*/
|
||||
<type> msc_inc_dangerous_neighbor_count(<params>);
|
||||
void msc_inc_dangerous_neighbor_count(MsCell cell);
|
||||
|
||||
/**
|
||||
* Provides the given marker of the given cell.
|
||||
|
|
@ -106,7 +113,7 @@
|
|||
* @return The marker carried by the cell
|
||||
* or `NONE`, if the cell is not valid.
|
||||
*/
|
||||
<type> msc_get_marker(<params>);
|
||||
CellMarker msc_get_marker(MsCell cell);
|
||||
|
||||
/**
|
||||
* Applies the given marker to the given cell. The marker is cleared
|
||||
|
|
@ -116,6 +123,6 @@
|
|||
* @param cell The cell instance in focus.
|
||||
* @param marker The marker to apply.
|
||||
*/
|
||||
<type> msc_set_marker(<params>);
|
||||
void msc_set_marker(MsCell cell, CellMarker marker);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue