ms_ui_utils.h is done

This commit is contained in:
MarcUs7i 2025-01-29 15:37:25 +01:00
parent 99c280f5aa
commit fc14ecbd44

View file

@ -1,4 +1,4 @@
</*---------------------------------------------------------- /*----------------------------------------------------------
* HTBLA-Leonding / Class: 2IHIF * HTBLA-Leonding / Class: 2IHIF
* --------------------------------------------------------- * ---------------------------------------------------------
* Exercise Number: B1 * Exercise Number: B1
@ -11,6 +11,11 @@
* ---------------------------------------------------------- * ----------------------------------------------------------
*/ */
#ifndef ___MS_UI_UTILS_H
#define ___MS_UI_UTILS_H
#include "general.h"
/** /**
* Initializes the random number generator. It must be invoked * Initializes the random number generator. It must be invoked
* at least once before function ´msu_get_random_index´ can be used. * at least once before function ´msu_get_random_index´ can be used.
@ -33,7 +38,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return ColAddr The corresponding column address or a '0' value, * @return ColAddr The corresponding column address or a '0' value,
* if the index cannot be mapped. * if the index cannot be mapped.
*/ */
<type> msu_idx_to_col_address(<params>); ColAddr msu_idx_to_col_address(CellIdx idx);
/** /**
* Maps the given cell index to the corresponding row address. * Maps the given cell index to the corresponding row address.
@ -42,7 +47,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return RowAddr The corresponding row address or a '0' value, * @return RowAddr The corresponding row address or a '0' value,
* if the index cannot be mapped. * if the index cannot be mapped.
*/ */
<type> msu_idx_to_row_address(<params>); RowAddr msu_idx_to_row_address(CellIdx idx);
/** /**
* Maps the given column address to the corresponding cell index. * Maps the given column address to the corresponding cell index.
@ -51,7 +56,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return CellIdx The corresponding cell index or 0, * @return CellIdx The corresponding cell index or 0,
* if the address cannot be mapped. * if the address cannot be mapped.
*/ */
<type> msu_col_address_to_index(<params>); CellIdx msu_col_address_to_index(ColAddr addr);
/** /**
* Maps the given row address to the corresponding cell index. * Maps the given row address to the corresponding cell index.
@ -60,7 +65,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return CellIdx The corresponding cell index or 0, * @return CellIdx The corresponding cell index or 0,
* if the address cannot be mapped. * if the address cannot be mapped.
*/ */
<type> msu_row_address_to_index(<params>); CellIdx msu_row_address_to_index(RowAddr addr);
/** /**
* Maps the given column address to the corresponding cell index. * Maps the given column address to the corresponding cell index.
@ -69,7 +74,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return CellIdx The corresponding cell index or 0, * @return CellIdx The corresponding cell index or 0,
* if the address cannot be mapped. * if the address cannot be mapped.
*/ */
<type> msu_col_address_to_index(<params>); CellIdx msu_col_address_to_index(ColAddr addr);
/** /**
* Provides the character a user may type to perform the given action. * Provides the character a user may type to perform the given action.
@ -79,7 +84,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return char The corresponding 'key' character or '\0', * @return char The corresponding 'key' character or '\0',
* if the action cannot reasonably be mapped. * if the action cannot reasonably be mapped.
*/ */
<type> msu_get_action_char(<params>); char msu_get_action_char(Action action);
/** /**
* Provides the action for the given 'key' character (the counterpart of ´msu_get_action_char´). * Provides the action for the given 'key' character (the counterpart of ´msu_get_action_char´).
@ -88,7 +93,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return Action The action corresponding to the given 'key' * @return Action The action corresponding to the given 'key'
* or 'INVALID',if the key cannot be mapped. * or 'INVALID',if the key cannot be mapped.
*/ */
<type> msu_get_action(<params>); Action msu_get_action(char key);
/** /**
* Maps the given cell marker to its presentation symbol * Maps the given cell marker to its presentation symbol
@ -98,7 +103,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return char The corresponding character or '#', if * @return char The corresponding character or '#', if
* the marker cannot be mapped. * the marker cannot be mapped.
*/ */
<type> msu_get_marker_symbol(<params>); char msu_get_marker_symbol(CellMarker marker);
/** /**
* Provides the symbol that represents a mine * Provides the symbol that represents a mine
@ -106,7 +111,7 @@ CellIdx msu_get_random_index(Count upper_limit);
* *
* @return char The symbol of a mine. * @return char The symbol of a mine.
*/ */
<type> msu_get_mine_symbol(); char msu_get_mine_symbol();
/** /**
* Maps the given game status to a user presentable label. * Maps the given game status to a user presentable label.
@ -115,4 +120,6 @@ CellIdx msu_get_random_index(Count upper_limit);
* @return char* The text for the status or 0, if * @return char* The text for the status or 0, if
* the status cannot be mapped. * the status cannot be mapped.
*/ */
<type> msu_get_status_label(<params>); char* msu_get_status_label(GameState status);
#endif