mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
* Keep track of entities * Fix renaming * Niagara variables wip * Several niagara decode and test * Move nodeTemplate code to dedicated file, self node added * Move node decoding functions to dedicated files * Move pin decoding logic to dedicated files * Accept space separated keys in objects * Build * Prevent a crash in case of incomplete object * Avoid creating objects unnecessarily * types formatting * Initial metasound style * Common pcg nodes colors * Fix string serialization * Metasound new styles and fixes * More metasound styles and colors * WIP * Several fixes * More tests and fixes * Clean gitignore
22 lines
747 B
JavaScript
22 lines
747 B
JavaScript
import Parsernostrum from "parsernostrum"
|
|
import Vector2DEntity from "./Vector2DEntity.js"
|
|
|
|
export default class RBSerializationVector2DEntity extends Vector2DEntity {
|
|
|
|
static grammar = this.createGrammar()
|
|
|
|
static createGrammar() {
|
|
return Parsernostrum.alt(
|
|
Parsernostrum.regArray(new RegExp(
|
|
/X\s*=\s*/.source + "(?<x>" + Parsernostrum.number.getParser().parser.regexp.source + ")"
|
|
+ "\\s+"
|
|
+ /Y\s*=\s*/.source + "(?<y>" + Parsernostrum.number.getParser().parser.regexp.source + ")"
|
|
)).map(({ groups: { x, y } }) => new this({
|
|
X: Number(x),
|
|
Y: Number(y),
|
|
})),
|
|
Vector2DEntity.grammar
|
|
)
|
|
}
|
|
}
|