Resolution conflits pour le merge avec persistance
continuous-integration/drone/push Build is failing Details

master
Loris OBRY 2 years ago
commit 72e85162ec

@ -1,7 +1,8 @@
using Model; using Model.Classes;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection.Emit;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Text; using System.Text;
@ -21,7 +22,16 @@ namespace ConsoleApp
Carte loup_garou = new Carte("Loup-Garou", "Il peut se reveiller chaque nuit pour voter avec les autres de son clan qui ils vont manger", "Il doit se faire passer pour un role du village, voter pour un de ses compagnons pour gagner la confiance peut etre un moyen", 4, "loup-garou", "Le loup-garou est un rôle très appréciable à jouer"); Carte loup_garou = new Carte("Loup-Garou", "Il peut se reveiller chaque nuit pour voter avec les autres de son clan qui ils vont manger", "Il doit se faire passer pour un role du village, voter pour un de ses compagnons pour gagner la confiance peut etre un moyen", 4, "loup-garou", "Le loup-garou est un rôle très appréciable à jouer");
<<<<<<< HEAD
Carte voyante = new Carte("Voyante", "La voyante est capable de voir le role d'un joueur, et ce, chaque nuit", "Elle ne doit pas se faire découvrir, surtout en debut de partie, donner des indices subtiles sans braquer tout les soupçons des loup-garou vers vous est l'objectif", 4, "villageois", "Une carte tres interessante et difficile a la fois, ce role emmene souvent à faire des sacrifices"); Carte voyante = new Carte("Voyante", "La voyante est capable de voir le role d'un joueur, et ce, chaque nuit", "Elle ne doit pas se faire découvrir, surtout en debut de partie, donner des indices subtiles sans braquer tout les soupçons des loup-garou vers vous est l'objectif", 4, "villageois", "Une carte tres interessante et difficile a la fois, ce role emmene souvent à faire des sacrifices");
=======
Utilisateur Kylian = new("Kyky", "12345", null);
Carte C = new("Villageois", "Aucuns", "Doit voter inteligemment", null, "lien", "une carte peu apprécié mais necesaire");
C.commentaires.Add(new Commentaire("Cette carte est la base du jeu, cool pour les debutants", Kylian ));
Pack P = new Pack("Jeu de base", "C'est la premiere version du jeu", 5);
Console.WriteLine(P.Nom);
Console.WriteLine(C.commentaires[0]);
>>>>>>> 0a7ee831209150d57559f3fd788a747cf8001bf5
string relativePath = "..\\..\\..\\Persistance"; string relativePath = "..\\..\\..\\Persistance";

@ -1,4 +1,4 @@
using Model; using Model.Classes;
using System.Diagnostics; using System.Diagnostics;
namespace MauiApp1; namespace MauiApp1;

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Classes
{
public class Camp
{
public string Nom { get; set; }
public string Description { get; set; }
public string LienImage { get; set; }
public List<Carte> Cartes { get; set; }
public Camp(string Nom, string Description, string LienImage)
{
this.Nom = Nom;
this.Description = Description;
this.LienImage = LienImage;
Cartes = new List<Carte>();
}
}
}

@ -9,13 +9,13 @@ using System.Runtime.CompilerServices;
using System.Net.Http.Headers; using System.Net.Http.Headers;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace Model namespace Model.Classes
{ {
[DataContract(Name = "carte")] [DataContract(Name = "carte")]
public class Carte : INotifyPropertyChanged public class Carte : INotifyPropertyChanged
{ {
public event PropertyChangedEventHandler? PropertyChanged; public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged([CallerMemberName] string ?propertyName = null) void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{ {
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
} }
@ -32,10 +32,11 @@ namespace Model
[DataMember] [DataMember]
public string Description { public string Description {
get => description; get => description;
set { set
{
description = value; description = value;
OnPropertyChanged(nameof(Description)); OnPropertyChanged(nameof(Description));
} }
} }
private string description; private string description;
[DataMember] [DataMember]
@ -88,10 +89,20 @@ namespace Model
OnPropertyChanged(nameof(LienImage)); OnPropertyChanged(nameof(LienImage));
} }
} }
public List<Commentaire> commentaires;
public List<Commentaire> Commentaires
{
get => commentaires;
set
{
commentaires = value;
OnPropertyChanged(nameof(Commentaires));
}
}
private string lienImage; private string lienImage;
public Carte(string nom, string pouvoir, string strategie, int? note, string lienImage, string description) public Carte(string nom, string pouvoir, string strategie, int? note, string lienImage, string description)
{ {
this.nom = nom; Nom = nom;
this.description = description; this.description = description;
this.pouvoir = pouvoir; this.pouvoir = pouvoir;
this.strategie = strategie; this.strategie = strategie;
@ -113,6 +124,7 @@ namespace Model
public bool Equals(Carte other) public bool Equals(Carte other)
{ {
return (this.nom == other.nom); return (this.nom == other.nom);
commentaires = new List<Commentaire>();
} }
} }
} }

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Classes
{
public class Commentaire
{
public string Texte { get; set; }
public Utilisateur Proprietaire { get; set; }
public Commentaire(string Texte, Utilisateur Proprietaire)
{
this.Texte = Texte;
this.Proprietaire = Proprietaire;
}
}
}

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Classes
{
public interface IContenu
{
public string Nom { get; set; }
public string Description { get; set; }
public int? Note { get; set; }
}
}

@ -5,7 +5,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Classes
{ {
public interface IDataManager public interface IDataManager
{ {

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Data; using System.Data;
namespace Model namespace Model.Classes
{ {
public class Manager : IDataManager public class Manager : IDataManager
{ {
@ -16,7 +16,7 @@ namespace Model
private IDataManager DataMgr { get; set; } private IDataManager DataMgr { get; set; }
public Manager(IDataManager dataManager) public Manager(IDataManager dataManager)
{ {
DataMgr = dataManager; DataMgr = dataManager;
Cartes = new(cartes); Cartes = new(cartes);
} }
public bool AddCarte(Carte carte) public bool AddCarte(Carte carte)
@ -26,7 +26,7 @@ namespace Model
if (cartes.Contains(carte)) return false; if (cartes.Contains(carte)) return false;
cartes.Add(carte); cartes.Add(carte);
DataMgr.AddCarte(carte); DataMgr.AddCarte(carte);
return true; return true;
} }

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Model.Classes
{
public class Pack : IContenu, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public string nom;
public string Nom
{
get => nom;
set
{
nom = value;
OnPropertyChanged(nameof(Nom));
}
}
public string description;
public string Description
{
get => description;
set
{
nom = value;
OnPropertyChanged(nameof(Description));
}
}
private int? note;
public int? Note
{
get
{
return note;
}
set
{
if (value < 0 || value > 10)
{
throw new ArgumentOutOfRangeException(nameof(value), "La valeur de la note doit être comprise entre 0 et 10.");
}
note = value;
OnPropertyChanged(nameof(Note));
}
}
public List<Commentaire> commentaires;
public List<Commentaire> Commentaires
{
get => commentaires;
set
{
commentaires = value;
OnPropertyChanged(nameof(Commentaires));
}
}
public Pack(string nom, string description, int? note)
{
this.nom = nom;
this.description = description;
this.note = note;
commentaires = new List<Commentaire>();
}
}
}

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.ComponentModel; using System.ComponentModel;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Model namespace Model.Classes
{ {
public class Utilisateur : INotifyPropertyChanged public class Utilisateur : INotifyPropertyChanged
{ {
Loading…
Cancel
Save