import { Direction, world } from "@minecraft/server"
import { Vector3 } from "../vector/vector3"

/**
 * 
 * @param {Direction} direction 
 * @param {Vector3} location 
 * @returns {Vector3}
 */
export function faceOffset(direction, location) {
    location = new Vector3().toVector(location)
    switch (direction) {
        case Direction.Up:
            location.y += 1
            break
        case Direction.Down:
            location.y -= 1
            break
        case Direction.North:
            location.z -= 1
            break
        case Direction.South:
            location.z += 1
            break
        case Direction.East:
            location.x += 1
            break
        case Direction.West:
            location.x -= 1
            break
    }

    return location
}

