package org.project;

import org.project.entity.players.Assassin;
import org.project.entity.players.Knight;
import org.project.entity.players.Player;
import org.project.entity.players.Wizard;
import org.project.location.GameDisplay;
import org.project.location.GameEngine;
import org.project.location.Location;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        while (true)
        {
            GameDisplay display = new GameDisplay();
            String choice = display.mainMenu();

            Scanner scanner;
            if (choice.equals("1"))
            {
                scanner = new Scanner(System.in);
                System.out.println(display.BLUE + "Enter your name :" + display.RESET);
                String n = scanner.nextLine();
                String c = display.chooseCharacter();
                Player p = null;

                if (c.equals("1")) p = new Knight(n);
                else if (c.equals("2")) p = new Assassin(n);
                else if (c.equals("3")) p = new Wizard(n);
                else
                {
                    System.out.println("Invalid option");
                    return;
                }
                GameEngine gameEngine = new GameEngine(p);
                gameEngine.runGame();
            }
            else if (choice.equals("2")) display.help();
            else if (choice.equals("3"))
            {
                System.out.println("GOOD BYE!");
                break;
            }
            else
            {
                System.out.println("Invalid option");
                return;
            }
        }
    }
}
