
/**
 *
 *
 * @author [Hesam Ghazi]
 * @version 1.0
 *
 * */
package org.project;

import org.project.entity.players.*;
import org.project.game.GameManager;
import org.project.item.weapons.*;
import org.project.location.Location;
import org.project.entity.enemies.*;
import org.project.utils.ConsoleColors;

public class Main {
    public static void main(String[] args) {
        // Create weapons
        Sword sword = new Sword();
        Staff staff = new Staff();
        Dagger dagger = new Dagger();

        // Create player (choose your class)
        Player player = new Knight("Sir Gallahad", sword);
        // Player player = new Assassin("Shadow", dagger);
        // Player player = new Wizard("Merlin", staff);

        // Create locations
        GameManager gameManager = getGameManager(player);

        // Start the game with colorful intro
        System.out.println(ConsoleColors.YELLOW_BOLD + "=== THE CURSE OF THE DRAGON ===" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.RED + "The land is cursed by an ancient dragon!" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.CYAN + "Collect the 3 keys to unlock the castle," + ConsoleColors.RESET);
        System.out.println(ConsoleColors.CYAN + "defeat the Dragon, and break the curse!" + ConsoleColors.RESET);
        System.out.println(ConsoleColors.PURPLE + "----------------------------------------" + ConsoleColors.RESET);
        gameManager.startGame();
    }

    private static GameManager getGameManager(Player player) {
        Location town = new Location("Town of Beginnings",
                "A peaceful town where your journey begins.");
        Location forest = new Location("Dark Forest",
                "A dense forest filled with dangerous creatures.");
        Location cave = new Location("Cave of Echoes",
                "A dark cave where the echoes of your footsteps are your only company.");
        Location castle = new Location("Castle of Doom",
                "The final stronghold of the evil dragon.");

        // Connect locations
        town.addConnectedLocation(forest);
        town.addConnectedLocation(cave);
        forest.addConnectedLocation(town);
        forest.addConnectedLocation(cave);
        cave.addConnectedLocation(town);
        cave.addConnectedLocation(forest);
        cave.addConnectedLocation(castle);
        castle.addConnectedLocation(cave);

        // Create game manager
        GameManager gameManager = new GameManager(player, town);

        // Add all locations to game manager
        gameManager.addLocation(town);
        gameManager.addLocation(forest);
        gameManager.addLocation(cave);
        gameManager.addLocation(castle);
        return gameManager;
    }
}