package cz.jzitnik.game.setup;

import cz.jzitnik.annotations.Dependency;
import cz.jzitnik.annotations.injectors.InjectDependency;
import cz.jzitnik.annotations.injectors.InjectState;
import cz.jzitnik.game.GameRoom;
import cz.jzitnik.game.GameState;
import cz.jzitnik.game.Player;
import cz.jzitnik.game.ResourceManager;
import cz.jzitnik.game.items.GameItem;
import cz.jzitnik.game.items.WoodenSword;
import cz.jzitnik.game.objects.Chest;
import cz.jzitnik.game.utils.RoomCords;
import cz.jzitnik.screens.scenes.IntroScene;
import cz.jzitnik.utils.DependencyManager;

@Dependency
public class GameSetup {
    @InjectState
    private GameState gameState;

    @InjectDependency
    private ResourceManager resourceManager;

    @InjectDependency
    private DependencyManager dependencyManager;

    public void setup() {
        gameState.setScreen(new IntroScene(dependencyManager));

        GameRoom mainRoom = new GameRoom(ResourceManager.Resource.ROOM1);
        GameRoom rightRoom = new GameRoom(ResourceManager.Resource.ROOM2);
        GameRoom topRightRoom = new GameRoom(ResourceManager.Resource.ROOM3);

        mainRoom.setRight(rightRoom);
        rightRoom.setUp(topRightRoom);

        Chest chest = new Chest(dependencyManager, resourceManager, new RoomCords(100, 45), new GameItem[]{
                new WoodenSword(resourceManager),
                new WoodenSword(resourceManager),
                new WoodenSword(resourceManager),
        });
        mainRoom.addObject(chest);

        gameState.setCurrentRoom(mainRoom);

        gameState.setPlayer(new Player(new RoomCords(90, 100)));
    }
}
