using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using JustNom.Menu;
using JustNom.OrdersFolder;
namespace JustNom.Menu
{
internal abstract class FoodMenu
{
public static int selectedNum;
public static int numberOfLines;
public abstract string TakeawayName();
public abstract List<string> Toppings();
public abstract List<string> Garnishes();
public abstract List<string> LoadedBurgers();
public abstract List<string> LoadedPizzas();
public static void LoadFoodMenu()
{
Console.WriteLine("");
Console.WriteLine("JustNom Order Manager");
Console.WriteLine("");
Console.WriteLine("Please select a menu to load.");
Console.WriteLine("");
string[] filePaths = Directory.GetFiles(@"C:\Users\Joe\Documents\Uni\Programming Portfolio\JustNom\JustNom\TestData", "*.nom");
int count1 = 1;
foreach (string file in filePaths)
{
Console.WriteLine($"{count1}. {Path.GetFileName(file)}");
count1 = count1 + 1;
}
selectedNum = ConsoleHelpers.GetIntegerInRange(1, count1, "Please select a valid menu");
string[] selectedFile = File.ReadLines(filePaths[selectedNum - 1]).ToArray();
StreamReader reader = new StreamReader(filePaths[selectedNum - 1]);
numberOfLines = 0;
while (!reader.EndOfStream)
{
reader.ReadLine();
numberOfLines++;
}
reader.BaseStream.Seek(0, SeekOrigin.Begin);
TakeawayName = selectedFile[0];
Console.WriteLine($"{selectedFile[2]}");
}
}
}