Files
ueblueprint/js/entity/SimpleSerializationRotatorEntity.js
barsdeveloper 1c2778fbf8 Still WIP
2024-05-28 16:44:39 +02:00

21 lines
644 B
JavaScript

import P from "parsernostrum"
import RotatorEntity from "./RotatorEntity.js"
export default class SimpleSerializationRotatorEntity extends RotatorEntity {
static grammar = P.alt(
P.regArray(new RegExp(
`(${P.number.getParser().parser.regexp.source})`
+ String.raw`\s*,\s*`
+ `(${P.number.getParser().parser.regexp.source})`
+ String.raw`\s*,\s*`
+ `(${P.number.getParser().parser.regexp.source})`
)).map(([_, p, y, r]) => new this({
R: Number(r),
P: Number(p),
Y: Number(y),
})),
RotatorEntity.grammar
)
}