diff --git a/Console/Console.csproj b/Console/Console.csproj new file mode 100644 index 0000000..390a34e --- /dev/null +++ b/Console/Console.csproj @@ -0,0 +1,14 @@ + + + + Exe + net7.0 + enable + enable + + + + + + + diff --git a/Console/Program.cs b/Console/Program.cs new file mode 100644 index 0000000..5c6913b --- /dev/null +++ b/Console/Program.cs @@ -0,0 +1,27 @@ +// See https://aka.ms/new-console-template for more information + +using Modèle; +using System; +using System.Reflection.PortableExecutable; + +//Création non permanente d'une liste de caractéristiques (pour tests) -> PEUT-ÊTRE EN FAIRE UNE CLASSE PLUS TARD??? +List charact = new List(); +charact.AddRange(new List { "Caractéristique 1", "C2", "C3", "ENCORE UNE CARACTÉRISTIQUE", "Again and again" }); + +//Création non permanente d'une liste d'apparences (pour tests) -> PEUT-ÊTRE EN FAIRE UNE CLASSE PLUS TARD AUSSI??? +List appear = new List(); +appear.AddRange(new List { "Wow1", "Wow2", "Wow3", "ENCORE UNE APPARENCE" }); + +Monstre monstre = new Monstre ( 1, "Warden", "Le Warden est une entité conçue pour vous traquer. Il est comme un GPS vivant capable d'optimiser ses déplacements pour vous contrer," + + " sachant que s'il n'arrive pas à vous coincer, il pourra toujours utiliser son attaque... [Plus]", charact, appear); +Console.WriteLine(monstre.IntroduceTest()); +Console.WriteLine(); +Console.WriteLine("Liste de mes caractéristiques :"); +monstre.CharacteristicsList.ForEach(Console.WriteLine); +Console.WriteLine(); +Console.WriteLine("Liste de mes apparences :"); +monstre.AppearanceList.ForEach(Console.WriteLine); +Console.WriteLine(); +Console.WriteLine(); +Monstre monstre2 = new Monstre(423, "Mouton", "Je suis un animal présent dans la campagne.", charact, appear); +Console.WriteLine(monstre2.IntroduceTest()); \ No newline at end of file diff --git a/Minecraft 2.sln b/Minecraft 2.sln index 530b3c8..7ff5ae2 100644 --- a/Minecraft 2.sln +++ b/Minecraft 2.sln @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31611.283 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vues", "Vues\Vues.csproj", "{6474A056-564C-44CE-910D-5B78BA1D8AAA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vues", "Vues\Vues.csproj", "{6474A056-564C-44CE-910D-5B78BA1D8AAA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console\Console.csproj", "{BCF060B8-BED1-4885-B9DD-F4BD391B6726}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modèle", "Modèle\Modèle.csproj", "{D11EF161-2695-4FCF-8A91-C2E736AF791E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -17,6 +21,14 @@ Global {6474A056-564C-44CE-910D-5B78BA1D8AAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {6474A056-564C-44CE-910D-5B78BA1D8AAA}.Release|Any CPU.Build.0 = Release|Any CPU {6474A056-564C-44CE-910D-5B78BA1D8AAA}.Release|Any CPU.Deploy.0 = Release|Any CPU + {BCF060B8-BED1-4885-B9DD-F4BD391B6726}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCF060B8-BED1-4885-B9DD-F4BD391B6726}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BCF060B8-BED1-4885-B9DD-F4BD391B6726}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCF060B8-BED1-4885-B9DD-F4BD391B6726}.Release|Any CPU.Build.0 = Release|Any CPU + {D11EF161-2695-4FCF-8A91-C2E736AF791E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D11EF161-2695-4FCF-8A91-C2E736AF791E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D11EF161-2695-4FCF-8A91-C2E736AF791E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D11EF161-2695-4FCF-8A91-C2E736AF791E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Modèle/Modèle.csproj b/Modèle/Modèle.csproj new file mode 100644 index 0000000..4658cbf --- /dev/null +++ b/Modèle/Modèle.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/Modèle/Monstre.cs b/Modèle/Monstre.cs new file mode 100644 index 0000000..0b92755 --- /dev/null +++ b/Modèle/Monstre.cs @@ -0,0 +1,48 @@ +using System.ComponentModel; +using System.Reflection.Metadata; + +namespace Modèle; + +public class Monstre +{ + public int Id { get; set; } = 1; + public string Name { get; set; } + public string Description { get; set; } = string.Empty; + + private List characteristic; + public List CharacteristicsList + { + get { + return characteristic; + } + set { + characteristic = value; + } + } + + private List appearance; + public List AppearanceList + { + get + { + return appearance; + } + set + { + appearance = value; + } + } + + public string IntroduceTest() + { + return $"Je suis un {Name} (id : {Id}). Description : {Description}"; + } + public Monstre(int id, string name, string desc, List characList, List appearList) + { + Id = id; + Name = name; + Description = desc; + CharacteristicsList = characList; + AppearanceList = appearList; + } +} \ No newline at end of file