Modification classes et tests

devGuillaume
Yoan BRUGIÈRE 2 years ago
parent 56ece0feb2
commit b3a48b4664

Binary file not shown.

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\Ohara.sln",
"PreviewInSolutionExplorer": false
}

@ -10,13 +10,13 @@ namespace Model
{
public string Nom { get; set; }
public string NomRomanise { get; set; }
public string Affiliation { get; set; }
public Equipage Affiliation { get; set; }
public int PremierChap { get; set; }
public int PremierEp { get; set; }
public string Description { get; set; }
public string Caracteristique { get; set; }
public Bateau(string nom, string nomRomanise, string affiliation, int premierChap, int premierEp, string description, string caracteristique)
public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique)
{
Nom = nom;
NomRomanise = nomRomanise;

@ -10,27 +10,25 @@ namespace Model
{
public string Nom { get; set; }
public string NomRomanise { get; set; }
public Personnage Capitaine { get; set; }
public string Region { get; set; }
public int PremierChap { get; set; }
public int PremierEp { get; set; }
public bool Statut { get; set; }
public string Description { get; set; }
public Personnage Membre { get; set; }
public Personnage Allie { get; set; }
public string? Description { get; set; }
public Personnage Capitaine { get; set; }
public List<Personnage> Membre { get; set; } = new List<Personnage>();
public List<Equipage> Allie { get; set; } = new List<Equipage>();
public Equipage(string nom, string nomRomanise, Personnage capitaine, string region, int premierChap, int premierEp, bool statut, string description, Personnage membre, Personnage allie)
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut,Personnage capitaine)
{
Nom = nom;
NomRomanise = nomRomanise;
Capitaine = capitaine;
Region = region;
PremierChap = premierChap;
PremierEp = premierEp;
Statut = statut;
Description = description;
Membre = membre;
Allie = allie;
Capitaine = capitaine;
}
}
}

@ -16,9 +16,9 @@ namespace Model
public string Description { get; set; }
public string Forces { get; set; }
public string Faiblesses { get; set; }
public Personnage Utilisateur { get; set; }
public List<Personnage> Utilisateur { get; set; }= new List<Personnage>();
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, Personnage utilisateur)
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses)
{
Nom = nom;
NomRomanise = nomRomanise;
@ -28,6 +28,10 @@ namespace Model
Description = description;
Forces = forces;
Faiblesses = faiblesses;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
{
Utilisateur = utilisateur;
}
}

@ -5,27 +5,31 @@
public string Nom { get; set; }
public string Epithete { get; set; }
public int Age { get; set; }
public float Taille { get; set; }
public FruitDuDemon Fruit { get; set; }
public double Taille { get; set; }
public string Origine { get; set; }
public string Equipage { get; set; }
public string Biographie { get; set; }
public string Citation { get; set; }
public Equipage? Equipage { get; set; }
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();
public Personnage(string nom, string epithete, int age, float taille, FruitDuDemon fruit, string origine, string equipage, string biographie, string citation)
public Personnage(string nom, string epithete, int age, double taille, string origine, string biographie, string citation)
{
Nom = nom;
Epithete = epithete;
Age = age;
Taille = taille;
Fruit = fruit;
Origine = origine;
Equipage = equipage;
Biographie = biographie;
Citation = citation;
}
public Personnage(string nom, string epithete, int age, double taille, string origine, string biographie, string citation,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,epithete,age,taille,origine,biographie,citation)
{
Equipage = equipage;
Fruit = fruit;
}
}
}

@ -1,2 +1,25 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
using Model;
FruitDuDemon nika = new FruitDuDemon("Fruit de l'humain modèle Nika", "Nika Nika No Mi", "Zoan Mythologique", 1, 1, "Le fruit ...", "Forces :", "Faiblesses :");
Personnage luffy = new Personnage("Monkey D. Luffy", "Chapeau de paille", 19,1.74,"East Blue","Monkey D. Luffy est...","Le Roi des Pirates ce sera moi !" );
Personnage zoro = new Personnage("Roronoa Zoro", "Chasseur de pirates", 21, 1.81, "East Blue", "Roronoa Zoro est ...", "Le plus grand des racistes ce sera moi !");
Personnage sanji = new Personnage("Sanji", "La jambe noire", 21, 1.80, "East Blue", "Sanji né Vinsmoke Sanji ..", "As-tu déjà entendu parler de All Blue ?");
Equipage mugi = new Equipage("Équipage au chapeau de paille","Mugiwara No Ichimi","East Blue",1,1,true,luffy);
nika.Utilisateur = new List<Personnage> { luffy };
luffy.Fruit = new List<FruitDuDemon> { nika };
luffy.Equipage= mugi;
zoro.Equipage = mugi;
sanji.Equipage = mugi;
mugi.Membre = new List<Personnage> { luffy, zoro, sanji };
foreach(Personnage p in mugi.Membre)
{
Console.WriteLine(p.Nom);
Console.WriteLine(p.Citation);
Console.WriteLine(p.Epithete);
}
Console.WriteLine(mugi.Capitaine.Nom);
Loading…
Cancel
Save