Skip to content
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

Merged
merged 3 commits into from
Jan 2, 2023
Merged

New Flagtype: ? #46

merged 3 commits into from
Jan 2, 2023

Conversation

chilla55
Copy link
Contributor

@chilla55 chilla55 commented Dec 3, 2022

I added a flag type(?) that I missed on bigger levels.

@Bollos00
Copy link
Owner

Very thanks for your contribution. Indeed it was a missing feature!

Sorry for the delay, I will review this today yet.

Copy link
Owner

@Bollos00 Bollos00 left a 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;
Copy link
Owner

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)
Copy link
Owner

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.

@Bollos00 Bollos00 changed the base branch from master to new-flag-type January 2, 2023 23:43
@Bollos00
Copy link
Owner

Bollos00 commented Jan 2, 2023

I will finish those changes on another branch and then merge on the main branch and release a new version. Thanks for the contribution!

@Bollos00 Bollos00 merged commit bd1be65 into Bollos00:new-flag-type Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants