Merge de master dans tests
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
a513ba8447
@ -0,0 +1,64 @@
|
||||
```plantuml
|
||||
|
||||
@startuml
|
||||
|
||||
package CoreLibrary <<Rectangle>> {
|
||||
package Core <<Rectangle>> {
|
||||
class Code
|
||||
class Plateau
|
||||
struct Jeton
|
||||
enum Couleur
|
||||
enum Indicateur
|
||||
}
|
||||
|
||||
package Joueurs <<Rectangle>> {
|
||||
class Joueur
|
||||
}
|
||||
|
||||
|
||||
package Regles <<Rectangle>> {
|
||||
interface IRegles
|
||||
class ReglesClassiques
|
||||
}
|
||||
|
||||
package Evenements <<Rectangle>> {
|
||||
class AjouterCodeEventArgs
|
||||
class AjouterJetonEventArgs
|
||||
class AjouterJoueurEventArgs
|
||||
class DebutPartieEventArgs
|
||||
class DemanderJetonEventArgs
|
||||
class DemanderJoueurEventArgs
|
||||
class NouveauTourEventArgs
|
||||
class PartieTermineeEventArgs
|
||||
class PasserMainEventArgs
|
||||
}
|
||||
|
||||
package Exceptions <<Rectangle>> {
|
||||
class CodeCompletException
|
||||
class CodeIncompletException
|
||||
class CodeInvalideException
|
||||
class CodeVideException
|
||||
class GrilleCompleteException
|
||||
class IndiceCodeException
|
||||
class PartieNonCommenceeException
|
||||
class TailleCodeException
|
||||
class TailleGrilleException
|
||||
}
|
||||
|
||||
class Partie
|
||||
}
|
||||
|
||||
package ConsoleApp <<Rectangle>> {
|
||||
class Program
|
||||
class Utils
|
||||
}
|
||||
|
||||
package System <<Rectangle>> {
|
||||
class Exception
|
||||
class EventArgs
|
||||
class Random
|
||||
}
|
||||
|
||||
@enduml
|
||||
|
||||
```
|
@ -1,11 +1,31 @@
|
||||
# mastermind
|
||||
[](https://codefirst.iut.uca.fr/nicolas.barbosa/mastermind)
|
||||
|
||||
SAE2.01 - Développement d'une application
|
||||
R2.02 - Développement d'applications avec IHM
|
||||
R2.03 - Qualité de développement
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
Mastermind en C#, MAUI, et .net
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
BARBOSA Céleste
|
||||
PRADY Pauline
|
||||
TURPIN-ETIENNE Camille
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
[](https://codefirst.iut.uca.fr/sonar/dashboard?id=celestebarbosa-mastermind)
|
||||
|
||||
---
|
||||
|
||||
# Mastermind - Projet IHM
|
||||
|
||||
**Céleste BARBOSA**\
|
||||
**Pauline PRADY**\
|
||||
**Camille TURPIN-ETIENNE**\
|
||||
|
||||
---
|
||||
|
||||
## Réalisation d'un jeu vidéo en .NET, C# & MAUI
|
||||
|
@ -1,88 +1,20 @@
|
||||
using CoreLibrary;
|
||||
using ConsoleApp;
|
||||
|
||||
using CoreLibrary;
|
||||
|
||||
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
|
||||
ReglesClassiques partie = new ReglesClassiques();
|
||||
|
||||
Utils.AfficherTitre();
|
||||
|
||||
Utils.AfficherTitre("Joueurs");
|
||||
|
||||
string joueur1;
|
||||
string joueur2;
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
joueur1 = Utils.SaisirNom();
|
||||
break;
|
||||
}
|
||||
catch(UtilsNomJoueurNullException)
|
||||
{
|
||||
Console.WriteLine("Nom invalide pour le joueur ! Ressaisir le nom");
|
||||
}
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
joueur2 = Utils.SaisirNom();
|
||||
break;
|
||||
}
|
||||
catch (UtilsNomJoueurNullException)
|
||||
{
|
||||
Console.WriteLine("Nom invalide pour le joueur 2 ! Ressaisir le nom");
|
||||
}
|
||||
}
|
||||
|
||||
Utils.AfficherSeparateur();
|
||||
|
||||
partie.AjouterJoueur(joueur1);
|
||||
partie.AjouterJoueur(joueur2);
|
||||
|
||||
partie.CommencerLaPartie();
|
||||
|
||||
while (!partie.EstTerminee())
|
||||
{
|
||||
Console.WriteLine(partie.JoueurCourant().Nom);
|
||||
Console.WriteLine();
|
||||
|
||||
Utils.DessinerPlateau(partie.JoueurCourant().Plateau.Grille(), partie.JoueurCourant().Plateau.Indicateurs());
|
||||
Console.WriteLine();
|
||||
|
||||
Code code = partie.GenererCode();
|
||||
|
||||
Utils.ChoixCode(ref code);
|
||||
|
||||
partie.JoueurCourant().Plateau.AjouterCode(code);
|
||||
|
||||
partie.PasserLaMain();
|
||||
|
||||
Utils.AfficherSeparateur();
|
||||
}
|
||||
|
||||
Console.WriteLine("La partie est maintenant terminée !");
|
||||
|
||||
Joueur[] gagnants = partie.Gagnants().ToArray();
|
||||
Joueur[] perdants = partie.Perdants().ToArray();
|
||||
Utils.DessinerTitre();
|
||||
|
||||
Partie maPartie = new Partie(new ReglesClassiques());
|
||||
|
||||
maPartie.DemanderJoueur += Evenements.DemanderJoueur;
|
||||
maPartie.DebutPartie += Evenements.CommencerLaPartie;
|
||||
maPartie.NouveauTour += Evenements.NouveauTour;
|
||||
maPartie.DemanderJeton += Evenements.DemanderJeton;
|
||||
maPartie.AjouterJeton += Evenements.AjouterJeton;
|
||||
maPartie.SupprimerDernierJeton += Evenements.SupprimerDernierJeton;
|
||||
maPartie.AjouterCode += Evenements.AjouterCode;
|
||||
maPartie.PartieTerminee += Evenements.PartieTerminee;
|
||||
|
||||
if (gagnants.Length > 1)
|
||||
{
|
||||
Console.WriteLine("C'est une égalité !");
|
||||
}
|
||||
else if (gagnants.Length == 1)
|
||||
{
|
||||
Console.WriteLine($"C'est une victoire de {gagnants[0].Nom}." +
|
||||
$"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("C'est une défaite...");
|
||||
}
|
||||
maPartie.Jouer();
|
||||
|
Loading…
Reference in new issue