package se.urmo.game.entities.ghost.strategy;

import se.urmo.game.entities.pacman.PacMan;
import se.urmo.game.entities.ghost.Ghost;
import se.urmo.game.map.GameMap;
import se.urmo.game.util.Direction;

import java.awt.Point;

public class PinkyStrategy implements GhostStrategy {
    @Override
    public Point chooseTarget(Ghost ghost, PacMan pacman, GameMap map) {
        Direction pacmanDir = pacman.getDirection();
        Point pacmanPos = pacman.getPosition();
        return switch (pacmanDir){
            case RIGHT -> new Point(pacmanPos.x + 8 * GameMap.MAP_TILESIZE, pacmanPos.y);
            case LEFT -> new Point(pacmanPos.x - 8 * GameMap.MAP_TILESIZE, pacmanPos.y);
            case DOWN -> new Point(pacmanPos.x, pacmanPos.y + 8 * GameMap.MAP_TILESIZE);
            case UP -> new Point(pacmanPos.x, pacmanPos.y - 8 * GameMap.MAP_TILESIZE);
            case NONE -> pacmanPos;
        };
    }
}
