/**
 * Given a player position and a set of enemy positions, this function returns a set of unique enemies.
 *
 * @param player The coordinates of the player (x, y).
 * @param enemies A set of enemy positions as tuples (x, y).
 * @return A set of unique enemy positions.
 */
fun findUniqueEnemies(player: Pair<Int, Int>, enemies: Set<Pair<Int, Int>>): Set<Pair<Int, Int>> {

    val uniqueEnemies = mutableSetOf<Pair<Int, Int>>()

    for (enemyPosition in enemies) {
        val (xPos, yPos) = enemyPosition
        val (xPlayer, yPlayer) = player

        if (xPlayer - 1 <= xPos && xPos <= xPlayer + 1 && yPlayer - 1 <= yPos && yPos <= yPlayer + 1) {
            uniqueEnemies.add(enemyPosition)
        }
    }

    return uniqueEnemies
}
/**
 * Given a player position and a set of enemy positions, this function returns a set of unique enemies.
 *
 * @param player The coordinates of the player (x, y).
 * @param enemies A set of enemy positions as tuples (x, y).
 * @return A set of unique enemy positions.
 */
fun findUniqueEnemies(player: Pair<Int, Int>, enemies: Set<Pair<Int, Int>>): Set<Pair<Int, Int>> {
/**
 * Given a player position and a set of enemy positions, this function returns a set of unique enemies.
 *
 * @param player The coordinates of the player (x, y).
 * @param enemies A set of enemy positions as tuples (x, y).
 * @return A set of unique enemy positions.
 */
fun findUniqueEnemies(player: Pair<Int, Int>, enemies: Set<Pair<Int, Int>>): Set<Pair<Int, Int>> {

    val uniqueEnemies = mutableSetOf<Pair<Int, Int>>()

    for (enemyPosition in enemies) {
        val (xPos, yPos) = enemyPosition
        val (xPlayer, yPlayer) = player

        if (xPlayer - 1 <= xPos && xPos <= xPlayer + 1 && yPlayer - 1 <= yPos && yPos <= yPlayer + 1) {
            uniqueEnemies.add(enemyPosition)
        }
    }

    return uniqueEnemies
}