This commit is contained in:
barsdeveloper
2024-05-31 15:09:48 +02:00
parent 1c2778fbf8
commit ecc71b76d1
45 changed files with 1191 additions and 1078 deletions

View File

@@ -1,13 +1,14 @@
import P from "parsernostrum"
import Grammar from "../serialization/Grammar.js"
import Vector2DEntity from "./Vector2DEntity.js"
export default class SimpleSerializationVector2DEntity extends Vector2DEntity {
static grammar = P.alt(
P.regArray(new RegExp(
`(${P.number.getParser().parser.regexp.source})`
`(${Grammar.numberRegexSource})`
+ String.raw`\s*,\s*`
+ `(${P.number.getParser().parser.regexp.source})`
+ `(${Grammar.numberRegexSource})`
)).map(([_, x, y]) => new this({
X: Number(x),
Y: Number(y),