Compare commits

...

3 Commits

@ -410,7 +410,7 @@ IDL_PROPERTY_SUPPORT = YES
# all members of a group must be documented explicitly.
# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
DISTRIBUTE_GROUP_DOC = YES
# If one adds a struct or class to a group and this option is enabled, then also
# any nested class or struct is added to the same group. By default this option
@ -504,25 +504,25 @@ EXTRACT_ALL = YES
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
EXTRACT_PRIVATE = YES
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
# The default value is: NO.
EXTRACT_PRIV_VIRTUAL = NO
EXTRACT_PRIV_VIRTUAL = YES
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
EXTRACT_PACKAGE = NO
EXTRACT_PACKAGE = YES
# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
# included in the documentation.
# The default value is: NO.
EXTRACT_STATIC = NO
EXTRACT_STATIC = YES
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
@ -538,7 +538,7 @@ EXTRACT_LOCAL_CLASSES = YES
# included.
# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
EXTRACT_LOCAL_METHODS = YES
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
@ -547,7 +547,7 @@ EXTRACT_LOCAL_METHODS = NO
# are hidden.
# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
EXTRACT_ANON_NSPACES = YES
# If this flag is set to YES, the name of an unnamed parameter in a declaration
# will be determined by the corresponding definition. By default unnamed
@ -659,7 +659,7 @@ INLINE_INFO = YES
# name. If set to NO, the members will appear in declaration order.
# The default value is: YES.
SORT_MEMBER_DOCS = YES
SORT_MEMBER_DOCS = NO
# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
# descriptions of file, namespace and class members alphabetically by member
@ -1535,7 +1535,7 @@ TOC_EXPAND = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
GENERATE_QHP = NO
# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
# the file name of the resulting .qch file. The path specified is relative to
@ -2368,13 +2368,13 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.
TAGFILES =
TAGFILES = qtsources.tags
# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
GENERATE_TAGFILE =
# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
# the class index. If set to NO, only the inherited external classes will be

@ -6,20 +6,109 @@
#include <QSettings>
#include <QString>
/**
* \brief The SameGame class. Stores the underlying informations of the game grid and its colors. Provides the base game functionality of checking the neighbours of clicked cells.
* The update of the grid though gets triggered from the #MainWindow.
*/
class SameGame
{
private:
/*!
* \brief the gameMatrix. Stores the colors of the grid inside of nested vectors.
* \todo make it all much much much more efficient by using std::size_t indices instead of [QStrings](#QString).
* -# Why do I have a list of colors if I am spamming the RAM with color name strings?
* -# this includes having to add the #QString used for the nonvalid color for each cell removed to the #colors list.
*/
std::vector<std::vector<QString>> gameMatrix;
/*!
* \brief Stores all the defined colors from the #settings unique pointer as [QStrings](#QString).
*/
const QStringList colors;
public:
/*!
* \name Initialisation
* \brief Functions that set-up the #gameMatrix.
* \{
*/
/*!
* \brief Initialises the game matrix.
*
* This function takes the number of rows and columns as arguments and creates a game grid of the respective size that it stores into #gameMatrix with randomly picked colors for each cell from #colors .
*
* \param rows the number of rows.
* \param columns the number of columns.
*/
void initialiseGameMatrix(int rows, int columns);
/*!
* \brief Constructor for the SameGame class. Takes the colors from #settings and stores them into #colors.
* \todo Why did I not make the amount of rows and columns constants read from #settings as well, like the #QStringList #colors?
* -# it is included in the #settings pointer anyways. no reason to have it being a variable.
* -# because of that, I am not going to group the rows and columns parameters of the constructor and the #initialiseGameMatrix() function like I did for the [selection parameters](#SelectionParameters).
* \param rows the number of rows.
* \param columns the number of columns.
*/
SameGame(int rows, int columns);
/*! \} */
/*!
* \name Cell functions
* \brief Functions that all use coordinates of a specific cell from the #gameMatrix as parameters.
* \param row Number of the row of cell to be selected.
* \param column Number of the column of the cell to be selected.
* \{
*/
/*!
* \brief getCell returns #gameMatrix[#row][#column].
* \return #QString color at the requested position.
*/
QString getCell(int row, int column);
/*!
* \brief setCell sets the value of #gameMatrix[#row][#column] to #color.
* \param color new color for the requested position.
*/
void setCell(int row, int column, QString color);
/*!
* \brief checkNeighbour
* \param connectedSet
* \param color
*/
void checkNeighbour(std::set<std::vector<int>> *connectedSet, QString color, int row, int column);
/*!
* \brief getConnected
* \param connectedSet
* \param color
*/
void getConnected(std::set<std::vector<int>> *connectedSet, QString color, int row, int column);
int getNumberOfColors();
/*!
* \brief deleteCell changes the color in the selected cell to an invalid value so that it will get taken out of the game.
*/
void deleteCell(int row, int column);
/*! \} */
/*!
* \name Information functions
* \brief Functions that provide information about the status of the #SameGame.
* \{
*/
/*!
* \brief getNumberOfColors returns number of unique colors.
* \todo check relevancy! Might be unneccessary due to colors being stored in #settings
* \return number of unique colors.
*/
int getNumberOfColors();
/*! \} */
};
#endif // SAMEGAME_H

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save