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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -25,10 +25,12 @@ namespace ConsoleApp
DisplayTab("Tableau 2 :", tab2); 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); 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(P.Nom);
Console.WriteLine(C.commentaires[0]);
} }
static void DisplayTab(string name, int[] tab) static void DisplayTab(string name, int[] tab)

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

@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Model namespace Model.Classes
{ {
public class Camp public class Camp
{ {
@ -17,7 +17,7 @@ namespace Model
this.Nom = Nom; this.Nom = Nom;
this.Description = Description; this.Description = Description;
this.LienImage = LienImage; 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.ComponentModel;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Model namespace Model.Classes
{ {
public class Carte : IContenu, INotifyPropertyChanged public class Carte : IContenu, 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));
} }
public string Nom { get; set; } public string Nom { get; set; }
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;
public string Pouvoir { public string Pouvoir
{
get => pouvoir; get => pouvoir;
set set
{ {
@ -85,13 +88,13 @@ namespace Model
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;
this.note = note; this.note = note;
this.lienImage = lienImage; this.lienImage = lienImage;
this.commentaires = new List<Commentaire>(); commentaires = new List<Commentaire>();
} }
} }
} }

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

@ -4,7 +4,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 IContenu public interface IContenu
{ {

@ -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
{ {

@ -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 Pack : IContenu, INotifyPropertyChanged public class Pack : IContenu, INotifyPropertyChanged
{ {
@ -27,7 +27,8 @@ namespace Model
} }
} }
public string description; public string description;
public string Description { public string Description
{
get => description; get => description;
set set
{ {
@ -67,7 +68,7 @@ namespace Model
this.nom = nom; this.nom = nom;
this.description = description; this.description = description;
this.note = note; 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.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