don't show the screen before we asked the user how many players he wants to play with for safari

This commit is contained in:
Mylloon 2024-01-06 15:54:50 +01:00
parent 445bc5bbae
commit de9046641a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -20,8 +20,6 @@ void help(char const *progName) {
}
int main(int argc, char const *argv[]) {
const Ecran e;
Ecran::toggleFps();
// Interface cli
if (argc >= 2) {
@ -39,6 +37,8 @@ int main(int argc, char const *argv[]) {
Butin b(j1, j2);
b.init();
const Ecran e;
e.afficher({[&]() { b.play(); }},
{[&](const int x, const int y) { b.event(x, y); }});
}
@ -48,6 +48,8 @@ int main(int argc, char const *argv[]) {
Dames d(j1, j2);
d.init();
const Ecran e;
e.afficher({[&]() { d.play(); }},
{[&](const int x, const int y) { d.event(x, y); }});
}
@ -57,7 +59,12 @@ int main(int argc, char const *argv[]) {
// TODO: demander à l'utilisateur un 3e joueur
Safari *s;
Joueur *j3 = nullptr;
if (true) {
int reponse = 3;
std::cout << "2 ou 3 joueurs ? ";
std::cin >> reponse;
if (reponse == 3) {
j3 = new Joueur(3);
s = new Safari(j1, j2, j3);
} else {
@ -65,6 +72,8 @@ int main(int argc, char const *argv[]) {
}
s->init();
const Ecran e;
e.afficher({[&]() { s->play(); }},
{[&](const int x, const int y) { s->event(x, y); }});