package se.urmo.game.main;

import lombok.Getter;
import se.urmo.game.util.FruitType;

public class LevelManager {

    public void nextLevel() {
        currentLevel = Level.forLevel(currentLevel.getLevel() + 1);
    }

    @Getter
    public enum Level {
        LEVEL1(1,6000, 0.75, 0.8, FruitType.CHERRY),
        LEVEL2(2, 6000, 0.75, 0.8, FruitType.CHERRY),
        LEVEL3(3, 6000, 0.75, 0.8, FruitType.CHERRY),
        LEVEL4(4, 6000, 0.75, 0.8, FruitType.CHERRY),
        LEVEL5(5, 3000, 0.85, 0.85, FruitType.CHERRY),
        LEVEL6(6, 3000, 0.85, 0.85, FruitType.CHERRY),
        LEVEL7(7, 3000, 0.85, 0.85, FruitType.CHERRY),
        LEVEL8(8, 3000, 0.85, 0.85, FruitType.CHERRY),
        LEVEL9(9, 3000, 0.85, 0.85, FruitType.CHERRY),
        LEVEL10(10, 1000, 0.95, 0.9, FruitType.CHERRY),
        LEVEL11(11, 1000, 0.95, 0.9, FruitType.CHERRY),
        LEVEL12(12, 1000, 0.95, 0.9, FruitType.CHERRY),
        LEVEL13(13, 1000, 0.95, 0.9, FruitType.CHERRY),
        LEVEL14(14, 6000, 0.95, 0.9, FruitType.CHERRY),
        LEVEL15(15,6000, 0.75, 0.85, FruitType.CHERRY),
        LEVEL16(16,6000, 0.75, 0.85, FruitType.CHERRY),
        LEVEL17(17,6000, 0.75, 0.85, FruitType.CHERRY),
        LEVEL18(18,6000, 0.75, 0.85, FruitType.CHERRY),
        LEVEL19(19,6000, 0.75, 0.85, FruitType.CHERRY);

        private final int frightendedDuration;
        private final double ghostSpeed;
        private final double pacmanSpeed;
        private final FruitType fruitType;
        private final int level;

        Level(int level, int frightendedDuration, double ghostSpeed, double pacmanSpeed, FruitType fruitType) {
            this.level = level;
            this.frightendedDuration = frightendedDuration;
            this.ghostSpeed = ghostSpeed;
            this.pacmanSpeed = pacmanSpeed;
            this.fruitType = fruitType;
        }
        public static Level forLevel(int i) {
            return Level.values()[i];
        }
    }
    @Getter
    private Level currentLevel = Level.LEVEL1;
    public double getPacmanLevelSpeed() {
        return currentLevel.pacmanSpeed;
    }
    public double getGhostSpeed() {
        return currentLevel.ghostSpeed;
    }
}
