dossiers pour ranger les classes et les managers
continuous-integration/drone/push Build is failing Details

pull/15/head
Guillaume REY 2 years ago
parent c66793b678
commit f21d5353bb

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "bateau")]
public class Bateau : ObjetOhara
@ -50,12 +50,12 @@ namespace Model
Caracteristique = caracteristique;
}
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image ) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique)
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom, nomRomanise, premierChap, premierEp, description, caracteristique)
{
Image = image;
}
public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique,image)
public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom, nomRomanise, premierChap, premierEp, description, caracteristique, image)
{
Affiliation = affiliation;
}

@ -7,7 +7,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "bestiaire")]
public class Bestiaire : ObjetOhara
@ -28,11 +28,11 @@ namespace Model
Caracteristique = caracteristique;
}
public Bestiaire(string nom, string origine, string description, string caracteristique,string image ) : this(nom,origine,description,caracteristique)
public Bestiaire(string nom, string origine, string description, string caracteristique, string image) : this(nom, origine, description, caracteristique)
{
Image=image;
Image = image;
}
}
}

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "equipage")]
public class Equipage : ObjetOhara
@ -29,14 +29,14 @@ namespace Model
public List<Personnage> Membre { get; set; } = new List<Personnage>();
[DataMember(Name = "allie")]
public List<Equipage> Allie { get; set; } = new List<Equipage>();
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description) : base(nom)
{
{
NomRomanise = nomRomanise;
Region = region;
if(premierEp < 0)
if (premierEp < 0)
{
PremierEp = 0;
}
@ -44,7 +44,7 @@ namespace Model
{
PremierEp = premierEp;
}
if(premierChap < 0)
if (premierChap < 0)
{
premierChap = 0;
}
@ -54,10 +54,10 @@ namespace Model
}
Statut = statut;
Description = description;
}
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description, string image) : this(nom, nomRomanise,region,premierChap,premierEp,statut,description)
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description, string image) : this(nom, nomRomanise, region, premierChap, premierEp, statut, description)
{
Image = image;

@ -6,12 +6,12 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "fruitdudemon")]
public class FruitDuDemon : ObjetOhara
{
[DataMember (Name = "nomromanise")]
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
[DataMember(Name = "type")]
public string Type { get; set; }
@ -25,14 +25,14 @@ namespace Model
public string Forces { get; set; }
[DataMember(Name = "faiblesses")]
public string Faiblesses { get; set; }
[DataMember(Name = "utilisateur",EmitDefaultValue = false)]
public List<Personnage> Utilisateur { get; set; }= new List<Personnage>();
[DataMember(Name = "utilisateur", EmitDefaultValue = false)]
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) : base(nom)
{
NomRomanise = nomRomanise;
Type = type;
if (premierEp < 0)
@ -56,13 +56,13 @@ namespace Model
Faiblesses = faiblesses;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image) : this(nom, nomRomanise,type,premierChap,premierEp,description,forces,faiblesses)
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image) : this(nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
{
Image = image;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses, image)
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image, List<Personnage> utilisateur) : this(nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses, image)
{
Utilisateur = utilisateur;
}

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "ile")]
public class Ile : ObjetOhara
@ -23,12 +23,12 @@ namespace Model
public string Description { get; set; }
[DataMember(Name = "geographie")]
public string Geographie { get; set; }
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie) : base(nom)
{
NomRomanise = nomRomanise;
Region = region;
if (premierEp < 0)
@ -49,13 +49,13 @@ namespace Model
}
Description = description;
Geographie = geographie;
}
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) : this(nom,nomRomanise,region,premierChap,premierEp,description,geographie)
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) : this(nom, nomRomanise, region, premierChap, premierEp, description, geographie)
{
Image = image;
Image = image;
}
}
}

@ -5,19 +5,19 @@ using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "objetohara")]
public class ObjetOhara
{
[DataMember (Name = "nom")]
[DataMember(Name = "nom")]
public string Nom { get; set; }
[DataMember (Name ="image")]
public string? Image { get; set;}
[DataMember(Name = "image")]
public string? Image { get; set; }
public bool EstFavori { get; set; }
public ObjetOhara(string nom,string image = "baseimage.png", bool estFavori = false)
public ObjetOhara(string nom, string image = "baseimage.png", bool estFavori = false)
{
Nom = nom;
Image = image;

@ -1,6 +1,6 @@
using System.Runtime.Serialization;
namespace Model
namespace Model.Classes
{
[DataContract(Name = "personnage")]
public class Personnage : ObjetOhara
@ -19,17 +19,17 @@ namespace Model
public string Biographie { get; set; }
[DataMember(Name = "citation")]
public string Citation { get; set; }
[DataMember(Name="equipage",EmitDefaultValue = false)]
[DataMember(Name = "equipage", EmitDefaultValue = false)]
public Equipage? Equipage { get; set; }
[DataMember(Name="fruit",EmitDefaultValue = false)]
[DataMember(Name = "fruit", EmitDefaultValue = false)]
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation) : base(nom)
{
if(prime < 0)
if (prime < 0)
{
Prime = 0;
}
@ -39,27 +39,27 @@ namespace Model
}
Epithete = epithete;
Age = age;
if(taille < 0)
if (taille < 0)
{
Taille = 0;
}
else
{
Taille= taille;
Taille = taille;
}
Origine = origine;
Biographie = biographie;
Citation = citation;
Citation = citation;
}
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image) : this(nom, prime,epithete,age,taille,origine,biographie,citation)
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image) : this(nom, prime, epithete, age, taille, origine, biographie, citation)
{
Image = image;
}
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image)
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image, Equipage equipage, List<FruitDuDemon> fruit) : this(nom, prime, epithete, age, taille, origine, biographie, citation, image)
{
Equipage = equipage;
Fruit = fruit;

@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model
namespace Model.Managers
{
public interface IDataManager
{

@ -1,12 +1,13 @@
using Model.Stub;
using Model.Classes;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
namespace Model.Managers
{
public class Manager
{
@ -14,7 +15,8 @@ namespace Model
public Manager() {
public Manager()
{
DataManager = new StubManager();
}
@ -46,9 +48,9 @@ namespace Model
public List<FruitDuDemon> FiltrerFDD(string type)
{
List<FruitDuDemon> fdd = GetFruits();
foreach(FruitDuDemon f in fdd.ToList())
foreach (FruitDuDemon f in fdd.ToList())
{
if(f.Type != type)
if (f.Type != type)
{
fdd.Remove(f);
}
@ -56,26 +58,28 @@ namespace Model
return fdd;
}
public List<FruitDuDemon> RechercheFDD(string text,List<FruitDuDemon> listeFDD)
public List<FruitDuDemon> RechercheFDD(string text, List<FruitDuDemon> listeFDD)
{
if (text == "") {
if (text == "")
{
return listeFDD;
}
foreach(FruitDuDemon f in listeFDD.ToList())
foreach (FruitDuDemon f in listeFDD.ToList())
{
bool correspondance = false;
int textPos = 0;
for (int i = 0; i < (f.Nom.Length); i++) {
for (int i = 0; i < f.Nom.Length; i++)
{
if (string.Equals(text[textPos].ToString(), f.Nom[i].ToString(), StringComparison.OrdinalIgnoreCase))
{
textPos++;
}
if(textPos == text.Length)
if (textPos == text.Length)
{
correspondance = true;
break;
}
}
if (!correspondance)
{
@ -94,7 +98,7 @@ namespace Model
listeFavoris.AddRange(GetFruits());
listeFavoris.AddRange(GetBestiaires());
listeFavoris.AddRange(GetPersonnages());
foreach(ObjetOhara obj in listeFavoris.ToList())
foreach (ObjetOhara obj in listeFavoris.ToList())
{
if (obj.EstFavori == true)
{

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>

@ -5,6 +5,8 @@ using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Model.Classes;
using Model.Managers;
namespace Model.Serializer
{

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using static System.Net.Mime.MediaTypeNames;
namespace Model.Stub

@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubBestiaire

@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubEquipage

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using static System.Net.Mime.MediaTypeNames;
namespace Model.Stub

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using Model.Managers;
namespace Model.Stub
{

@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{

@ -1,4 +1,4 @@
using Model;
using Model.Managers;
using Plugin.Maui.Audio;
namespace Ohara;

@ -1,6 +1,7 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Classes;
using Model.Managers;
namespace Ohara;

@ -1,7 +1,8 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using System.Windows.Input;
using Model.Classes;
using Model.Managers;
namespace Ohara;

@ -1,5 +1,6 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;

@ -1,7 +1,8 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
using System.Windows.Input;

@ -1,4 +1,5 @@
using Model;
using Model.Classes;
using Model.Managers;
using Plugin.Maui.Audio;
namespace Ohara;

@ -1,6 +1,7 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Classes;
using Model.Managers;
namespace Ohara;

@ -1,6 +1,6 @@
using Model.Stub;
using Model;
using System.Windows.Input;
using Model.Classes;
namespace Ohara;

@ -1,5 +1,5 @@
using Model.Stub;
using Model;
using Model.Classes;
namespace Ohara;

@ -1,5 +1,5 @@
using Model.Stub;
using Model;
using Model.Classes;
namespace Ohara;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using Model.Stub;
namespace Ohara;

@ -1,5 +1,5 @@
using Model.Stub;
using Model;
using Model.Classes;
namespace Ohara;

@ -1,7 +1,6 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Classes;
namespace Ohara;

@ -1,6 +1,7 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;

@ -1,5 +1,6 @@
// See https://aka.ms/new-console-template for more information
using Model;
using Model.Classes;
using Model.Serializer;
var manager = new Manager();

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;

Loading…
Cancel
Save