Some pokedex stuff

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-26 13:08:34 +01:00
parent 02e0b0815f
commit 8a1b696755
4 changed files with 67 additions and 0 deletions

View 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

View 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>

View 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()
{
}
}

View 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}");
}
}
}