Some pokedex stuff
This commit is contained in:
parent
02e0b0815f
commit
8a1b696755
16
Emne 3/PokeDex/PokeDex.sln
Normal file
16
Emne 3/PokeDex/PokeDex.sln
Normal file
|
@ -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
|
10
Emne 3/PokeDex/PokeDex/PokeDex.csproj
Normal file
10
Emne 3/PokeDex/PokeDex/PokeDex.csproj
Normal file
|
@ -0,0 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
24
Emne 3/PokeDex/PokeDex/Pokedex.cs
Normal file
24
Emne 3/PokeDex/PokeDex/Pokedex.cs
Normal file
|
@ -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()
|
||||
{
|
||||
}
|
||||
}
|
17
Emne 3/PokeDex/PokeDex/Program.cs
Normal file
17
Emne 3/PokeDex/PokeDex/Program.cs
Normal file
|
@ -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}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue