-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Flagtype: ? #46
New Flagtype: ? #46
Conversation
Very thanks for your contribution. Indeed it was a missing feature! Sorry for the delay, I will review this today yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it's all fine. Congratulations!
@@ -39,7 +39,7 @@ class LibreMinesGameEngine: public QObject | |||
|
|||
CELL_STATE state; | |||
bool isHidden; | |||
bool hasFlag; | |||
int FlagType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the attribute FlagType
should be flagType
.
I think it is appropriate to create an enum for the Flag Type. Like so:
enum class FlagType : quint8
{
NoFlag = 0,
HasFlag = 1,
Question = 2
};
That way, all references to FlagType would use this enum. Like:
...
if (cellGE.flagType == FlagType::Question)
img = fieldTheme.getPixmapQuestion().toImage();
...
Q_EMIT SIGNAL_unflagCell(_X, _Y); | ||
} | ||
else if (principalMatrix[_X][_Y].FlagType == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to have an boolean attribute of the GameEngine Class that indicates whether to use the question or not. This attribute would change a little this function.
This option would be set by the user with a check box on the preferences dialog.
I will finish those changes on another branch and then merge on the main branch and release a new version. Thanks for the contribution! |
I added a flag type(?) that I missed on bigger levels.