import { IMoveInput } from "../Input/MoveInput";
import { Vector3 } from "three";

export class MoveC {
    private readonly input: IMoveInput;
    private readonly speed: number;
    private readonly moveDirection = new Vector3();

    get Direction() {
        return this.moveDirection;
    }

    get Weight() {
        return this.moveDirection.length() / this.speed;
    }

    constructor(input: IMoveInput, speed = 5) {
        this.input = input;
        this.speed = speed;
    }

    update(_delta: number) {
        this.moveDirection.copy(this.input.CurrentDirection).multiplyScalar(this.speed);
    }
}
