Super dirty codealong app
This commit is contained in:
parent
9aecbbd1b1
commit
4f8b991da6
|
@ -41,9 +41,9 @@ public class App
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine("Velkommen til Oppskrifts appen: ");
|
Console.WriteLine("Velkommen til Oppskrifts appen: ");
|
||||||
Console.WriteLine("1. Vis liste over alle oppskriftene");
|
Console.WriteLine("1.) Vis liste over alle oppskriftene:");
|
||||||
Console.WriteLine("2. Søk på ingrediens");
|
Console.WriteLine("2.) Filtrer på kategori");
|
||||||
Console.WriteLine("3. Søk på kategori");
|
Console.WriteLine("3.) Filtrer på ingrdiensene");
|
||||||
Console.WriteLine("q. for å avslutte");
|
Console.WriteLine("q. for å avslutte");
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,10 +54,10 @@ public class App
|
||||||
ShowDishNamesMenu();
|
ShowDishNamesMenu();
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
ShowDishByIngredientsMenu();
|
ShowDishCategoryMenu();
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
ShowDishByCategoryMenu();
|
ShowIngredientsMenu();
|
||||||
break;
|
break;
|
||||||
case "q":
|
case "q":
|
||||||
running = false;
|
running = false;
|
||||||
|
@ -92,6 +92,38 @@ public class App
|
||||||
Console.ReadLine();
|
Console.ReadLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ShowIngredientsMenu()
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Filtrer basert på ingrediens: ");
|
||||||
|
var search = Console.ReadLine();
|
||||||
|
var dishes = Dish.Where(d => d.Ingredients.Contains(search));
|
||||||
|
Console.WriteLine($"Retter med {search}");
|
||||||
|
foreach (var dish in dishes)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{dish.NameOfDish} - {dish.DescriptionOfDish}");
|
||||||
|
}
|
||||||
|
Console.WriteLine("Trykk for å gå tilbake");
|
||||||
|
Console.ReadKey();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShowDishCategoryMenu()
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
Console.WriteLine("Filtre basert på kategori: ");
|
||||||
|
Console.WriteLine("Kategorier: Middag - Forkost - Lunsj - Dessert - Bakverk");
|
||||||
|
var input = Console.ReadLine();
|
||||||
|
var dish = Dish.Where(d => d.Categories.Contains(input));
|
||||||
|
Console.WriteLine($"Retter i {input} kategorien");
|
||||||
|
foreach (var d in dish)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{d.NameOfDish} - {d.DescriptionOfDish}");
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class Dish
|
||||||
} ;
|
} ;
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
public void ShowDishByIngredientsMenu()
|
public void ShowDishByIngredients()
|
||||||
{
|
{
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
Console.WriteLine("Tilgjengelige ingredienter: ");
|
Console.WriteLine("Tilgjengelige ingredienter: ");
|
||||||
|
|
16
Emne 3/PokemonMarie/PokemonMarie.sln
Normal file
16
Emne 3/PokemonMarie/PokemonMarie.sln
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PokemonMarie", "PokemonMarie\PokemonMarie.csproj", "{10578A67-5571-4BDE-852C-ECD52CDBFDCA}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{10578A67-5571-4BDE-852C-ECD52CDBFDCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{10578A67-5571-4BDE-852C-ECD52CDBFDCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{10578A67-5571-4BDE-852C-ECD52CDBFDCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{10578A67-5571-4BDE-852C-ECD52CDBFDCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
6
Emne 3/PokemonMarie/PokemonMarie/PokeGym.cs
Normal file
6
Emne 3/PokemonMarie/PokemonMarie/PokeGym.cs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
namespace PokemonMarie;
|
||||||
|
|
||||||
|
public class PokeGym
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
6
Emne 3/PokemonMarie/PokemonMarie/PokeShop.cs
Normal file
6
Emne 3/PokemonMarie/PokemonMarie/PokeShop.cs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
namespace PokemonMarie;
|
||||||
|
|
||||||
|
public class PokeShop
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
8
Emne 3/PokemonMarie/PokemonMarie/Pokemon.cs
Normal file
8
Emne 3/PokemonMarie/PokemonMarie/Pokemon.cs
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
namespace PokemonMarie;
|
||||||
|
|
||||||
|
public class Pokemon
|
||||||
|
{
|
||||||
|
int Levet { get; set; }
|
||||||
|
string Type { get; set; }
|
||||||
|
string Name { get; set; }
|
||||||
|
}
|
10
Emne 3/PokemonMarie/PokemonMarie/PokemonMarie.csproj
Normal file
10
Emne 3/PokemonMarie/PokemonMarie/PokemonMarie.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>
|
26
Emne 3/PokemonMarie/PokemonMarie/PokemonWorld.cs
Normal file
26
Emne 3/PokemonMarie/PokemonMarie/PokemonWorld.cs
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
using System.ComponentModel.Design;
|
||||||
|
|
||||||
|
namespace PokemonMarie;
|
||||||
|
|
||||||
|
public class PokemonWorld
|
||||||
|
{
|
||||||
|
public Trainer MyTrainer { get; set; }
|
||||||
|
public Pokemon StartPokemon { get; set; }
|
||||||
|
public List<Pokemon> WildPokemons { get; set; }
|
||||||
|
|
||||||
|
public PokemonWorld()
|
||||||
|
{
|
||||||
|
MyTrainer = new Trainer("Ash");
|
||||||
|
WildPokemons = new List<Pokemon>()
|
||||||
|
{
|
||||||
|
new Pokemon(),
|
||||||
|
new Pokemon()
|
||||||
|
};
|
||||||
|
Menu();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Menu()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Welcome to Pokemon");
|
||||||
|
}
|
||||||
|
}
|
23
Emne 3/PokemonMarie/PokemonMarie/Program.cs
Normal file
23
Emne 3/PokemonMarie/PokemonMarie/Program.cs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
// Pokemon
|
||||||
|
// Stats - Level
|
||||||
|
// Type
|
||||||
|
// Name
|
||||||
|
|
||||||
|
// Trainer
|
||||||
|
// Pokemon[]
|
||||||
|
// List<string> Inventory
|
||||||
|
// currentPokemon
|
||||||
|
// GoToWilderness()
|
||||||
|
// BattlePokemon()
|
||||||
|
// CatchPokemon()
|
||||||
|
// EnterStore()
|
||||||
|
// BuyItem(string itemType)
|
||||||
|
// Pokemonworld
|
||||||
|
// List<Pokemon> WildPokemon
|
||||||
|
// GetRandomPokemon(string type)
|
||||||
|
// PokemonShop
|
||||||
|
// List<string> StoreInventory
|
||||||
|
// PokeGym
|
||||||
|
// GymTrainer
|
||||||
|
|
||||||
|
|
7
Emne 3/PokemonMarie/PokemonMarie/Trainer.cs
Normal file
7
Emne 3/PokemonMarie/PokemonMarie/Trainer.cs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
namespace PokemonMarie;
|
||||||
|
|
||||||
|
internal class Trainer
|
||||||
|
{
|
||||||
|
public List<string> Inventory { get; set; }
|
||||||
|
public Pokemon Pokemon { get; private set; }
|
||||||
|
}
|
Loading…
Reference in a new issue