-
Notifications
You must be signed in to change notification settings - Fork 0
ajout variantes #30
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
base: dev
Are you sure you want to change the base?
ajout variantes #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,14 +6,18 @@ | |
| #include "UI/GamePushButton.hpp" | ||
| #include <QLineEdit> | ||
| #include <QComboBox> | ||
| #include <array> | ||
| #include "Jeu.hpp" | ||
|
|
||
|
|
||
|
|
||
| class StartMenu : public QWidget { | ||
| Q_OBJECT | ||
| public: | ||
| StartMenu(QWidget* parent = nullptr); | ||
| ~StartMenu() override; | ||
| signals: | ||
| void playerSelectionConfirmed(std::vector<std::string> players, uint32_t difficultyLevel); | ||
| void playerSelectionConfirmed(std::vector<std::string> players, uint32_t difficultyLevel, std::array<int,5>variantes, Duree d); | ||
|
|
||
| private slots: | ||
| void onConfirmClicked(); | ||
|
|
@@ -28,8 +32,12 @@ private slots: | |
|
|
||
| QComboBox* dificultyComboBox; | ||
|
|
||
|
|
||
| QVBoxLayout* variantesLayout; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? |
||
|
|
||
| QHBoxLayout* longueurLayout; | ||
| uint32_t playerCount; | ||
| uint32_t dificultyLevel; | ||
| std::array<int,5> variantes; | ||
| Duree duree; | ||
| std::vector<QLineEdit*> playerButtons; | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -561,7 +561,7 @@ bool CiteJoueur::placerTuileFromHexRef(Hexagone *hex) | |
| // updateFantomeOfTuile(tl); | ||
| } | ||
|
|
||
| uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | ||
| uint32_t CiteJoueur::compterPoints( int niveau_difficulte, std::array<int,5>variantes) const | ||
| { | ||
| uint32_t nb_place_bleue = 0; | ||
| uint32_t nb_place_rouge = 0; | ||
|
|
@@ -635,6 +635,7 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| { | ||
| const std::array<Hexagone *, 6> voisins = h->getVoisins3D(); | ||
| bool cond = true; | ||
| int var = 1; | ||
| for (int i = 0; i < 6; i++) | ||
| { | ||
|
|
||
|
|
@@ -646,8 +647,20 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| } | ||
| } | ||
| } | ||
| if (cond == true) | ||
| points_jaune += 1 * niveau; | ||
| //variante si on a une place jaune, on double les points | ||
| if(variantes[0]==1){ | ||
| for (int i = 0; i < 6; i++){ | ||
| if (voisins[i] != nullptr){ | ||
| if (voisins[i]->getCouleur() == Couleur::Jaune && voisins[i]->getType() == Type::Place){ | ||
| var=2; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| if (cond == true) points_jaune += 1 * niveau * var; | ||
|
|
||
|
|
||
|
|
||
| } | ||
| // calcul points jardins : +1 pt pour chaque jardin | ||
| if (h->getCouleur() == Couleur::Vert) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ajouter algo détection de lac pour les quartier vert |
||
|
|
@@ -659,6 +672,7 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| { | ||
|
|
||
| const std::array<Hexagone *, 6> &voisins = h->getVoisins3D(); | ||
| int var =1; | ||
|
|
||
| // on vérifie si entierment entouré au niveau 0 | ||
| bool cond = true; | ||
|
|
@@ -674,8 +688,12 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| cond = false; | ||
| } | ||
| } | ||
| if (cond) | ||
| points_violet += 1 * niveau; | ||
| if(variantes[2]==1){ | ||
| if(niveau>1){ | ||
| var = 2; | ||
| } | ||
| if (cond) points_violet += 1 * niveau * var; | ||
| } | ||
| } | ||
| // calcul habitation: on doit calculer les groupes d'habitations | ||
| if (h->getCouleur() == Couleur::Bleu) | ||
|
|
@@ -718,7 +736,7 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| { | ||
| bool cond = false; | ||
| const std::array<Hexagone *, 6> &voisins = h->getVoisins3D(); | ||
|
|
||
| int var = 1; | ||
| for (int i = 0; i < 6; i++) | ||
| { | ||
| if (voisins[i] != nullptr) | ||
|
|
@@ -731,8 +749,24 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| cond = true; | ||
| } | ||
| } | ||
| if (cond) | ||
| points_rouge += 1 * niveau; | ||
| if(variantes[4]==1){ | ||
| int cases_vides = 0; | ||
| for (int i = 0; i < 6; i++){ | ||
| if (voisins[i] != nullptr){ | ||
| if (voisins[i]->getType() == Type::Fantome) | ||
| cases_vides++; | ||
| } | ||
| else | ||
| { | ||
| cases_vides++; | ||
| } | ||
|
|
||
| } | ||
| if(cases_vides>=3){ | ||
| var = 2; | ||
| } | ||
| } | ||
| if (cond) points_rouge += 1 * niveau * var; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. carré |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -748,6 +782,11 @@ uint32_t CiteJoueur::compterPoints( int niveau_difficulte) const | |
| if (!habitations_visitees.empty()) | ||
| { | ||
| points_bleu = *std::max_element(points_hab.begin(), points_hab.end()); | ||
| if(variantes[3]==1){ | ||
| if(points_bleu>=10){ | ||
| points_bleu=points_bleu*2; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 |
||
| } | ||
| } | ||
| } | ||
|
|
||
| //std::cout << "printing points : " << points_bleu * nb_place_bleue * 1 << " . " << points_jaune * nb_place_jaune * 2 << " . " << points_rouge * nb_place_rouge * 2 << " . " << points_vert * nb_place_verte * 3 << " . " << points_violet * nb_place_violet * 2 << std::endl; | ||
|
|
@@ -869,7 +908,7 @@ void Cite::release_hex_fantome() | |
| } | ||
| hexs_fantome.clear(); | ||
| }; | ||
| uint32_t CiteIllu::compterPoints( int niveau_difficulte) const { | ||
| uint32_t CiteIllu::compterPoints( int niveau_difficulte, std::array<int,5> variantes) const { | ||
Hypocrate-code marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| uint32_t nb_carriere = 0; | ||
|
|
||
|
|
||
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.
juste faire belek à pas inclure le cmakelists mais oklm