diff --git a/Emne 3/PokeDex/PokeDex.sln b/Emne 3/PokeDex/PokeDex.sln new file mode 100644 index 0000000..aa5f3e2 --- /dev/null +++ b/Emne 3/PokeDex/PokeDex.sln @@ -0,0 +1,16 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokeDex", "PokeDex\PokeDex.csproj", "{FCA84B3A-09B1-4E5B-A969-0B297315C166}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FCA84B3A-09B1-4E5B-A969-0B297315C166}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCA84B3A-09B1-4E5B-A969-0B297315C166}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCA84B3A-09B1-4E5B-A969-0B297315C166}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCA84B3A-09B1-4E5B-A969-0B297315C166}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Emne 3/PokeDex/PokeDex/PokeDex.csproj b/Emne 3/PokeDex/PokeDex/PokeDex.csproj new file mode 100644 index 0000000..2f4fc77 --- /dev/null +++ b/Emne 3/PokeDex/PokeDex/PokeDex.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/Emne 3/PokeDex/PokeDex/Pokedex.cs b/Emne 3/PokeDex/PokeDex/Pokedex.cs new file mode 100644 index 0000000..7aa6d66 --- /dev/null +++ b/Emne 3/PokeDex/PokeDex/Pokedex.cs @@ -0,0 +1,24 @@ +namespace Pokedex; + + internal class Pokemon + { + public string Name { get; set; } + public int Level { get; set; } + public int Health { get; set; } + + public Pokemon(string name, int level, int health) + { + Name = name; + Level = level; + Health = health; + } + + public Pokemon(string name) + { + Name = name; + } + + public Pokemon() + { + } + } \ No newline at end of file diff --git a/Emne 3/PokeDex/PokeDex/Program.cs b/Emne 3/PokeDex/PokeDex/Program.cs new file mode 100644 index 0000000..81efd92 --- /dev/null +++ b/Emne 3/PokeDex/PokeDex/Program.cs @@ -0,0 +1,17 @@ +namespace Pokedex +{ + class Program + { + static void Main(string[] args) + { + Pokemon pikachu = new Pokemon( "Pikachu", 12, 22); + Pokemon noname = new Pokemon( "NoName"); + Pokemon nothing = new Pokemon(); + + Console.WriteLine($"Navn: {pikachu.Name}\nHelse: {pikachu.Health}\nNivå: {pikachu.Level}"); + Console.WriteLine($"Navn: {noname.Name}\nHelse: {noname.Health}\nNivå: {noname.Level}"); + Console.WriteLine($"Navn: {nothing.Name}\nHelse: {nothing.Health}\nNivå: {nothing.Level}"); + } + } +} +