Ajout dossier Classes
continuous-integration/drone/push Build is passing Details

master
Loris OBRY 2 years ago
parent 4da35da005
commit 0a7ee83120

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -25,10 +25,12 @@ namespace ConsoleApp
DisplayTab("Tableau 2 :", tab2);
*/
Carte C = new Carte("Villageois", "Aucuns", "Doit voter inteligemment", null, "lien", "une carte peu apprécié mais necesaire");
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(C.Nom);
Console.WriteLine(P.Nom);
Console.WriteLine(C.commentaires[0]);
}
static void DisplayTab(string name, int[] tab)

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

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
namespace Model.Classes
{
public class Camp
{
@ -17,7 +17,7 @@ namespace Model
this.Nom = Nom;
this.Description = Description;
this.LienImage = LienImage;
this.Cartes = new List<Carte>();
Cartes = new List<Carte>();
}
}
}

@ -7,26 +7,29 @@ using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Model
namespace Model.Classes
{
public class Carte : IContenu, INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
void OnPropertyChanged([CallerMemberName] string ?propertyName = null)
void OnPropertyChanged([CallerMemberName] string? propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public string Nom { get; set; }
public string Description {
public string Description
{
get => description;
set {
set
{
description = value;
OnPropertyChanged(nameof(Description));
}
}
}
private string description;
public string Pouvoir {
public string Pouvoir
{
get => pouvoir;
set
{
@ -85,13 +88,13 @@ namespace Model
private string lienImage;
public Carte(string nom, string pouvoir, string strategie, int? note, string lienImage, string description)
{
this.Nom = nom;
Nom = nom;
this.description = description;
this.pouvoir = pouvoir;
this.strategie = strategie;
this.note = note;
this.lienImage = lienImage;
this.commentaires = new List<Commentaire>();
commentaires = new List<Commentaire>();
}
}
}

@ -4,9 +4,9 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
namespace Model.Classes
{
internal class Commentaire
public class Commentaire
{
public string Texte { get; set; }
public Utilisateur Proprietaire { get; set; }

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

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

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

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Model
namespace Model.Classes
{
public class Pack : IContenu, INotifyPropertyChanged
{
@ -27,14 +27,15 @@ namespace Model
}
}
public string description;
public string Description {
public string Description
{
get => description;
set
{
nom = value;
OnPropertyChanged(nameof(Description));
}
}
}
private int? note;
public int? Note
{
@ -67,7 +68,7 @@ namespace Model
this.nom = nom;
this.description = description;
this.note = note;
this.commentaires = new List<Commentaire>();
commentaires = new List<Commentaire>();
}
}
}

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