import { seededRandom } from "../../../core/math/random/seededRandom.js";
import { MarkerNodeTransformer } from "./MarkerNodeTransformer.js";

export class MarkerNodeTransformRotateRandom extends MarkerNodeTransformer {

    seed = 0;

    random = seededRandom(0);

    static from(seed = 0) {
        const r = new MarkerNodeTransformRotateRandom();

        r.seed = seed;

        return r;
    }

    initialize(grid, seed) {
        this.random.setCurrentSeed(seed + this.seed);
    }

    transform(node, grid) {
        const result = node.clone();

        result.transform.rotation.random(this.random);

        return result;
    }
}
