Grammar fixed

This commit is contained in:
barsdeveloper
2021-10-22 18:44:44 +02:00
parent 051eed061d
commit a34be2351e
10 changed files with 188 additions and 97 deletions

View File

@@ -39,10 +39,7 @@ export default class Entity {
fullKey,
target[property],
defaultValue,
(t, _, v) => {
console.log(v)
t.push(v)
})
(t, _, v) => t.push(v))
continue
}
if (defaultValue instanceof TypeInitialization) {

View File

@@ -3,10 +3,7 @@ import ObjectReferenceEntity from "./ObjectReferenceEntity"
export default class FunctionReferenceEntity extends Entity {
static attributes = {
MemberParent: new ObjectReferenceEntity({
type: "Class",
path: "/Script/Engine.GameplayStatics"
}),
MemberParent: ObjectReferenceEntity,
MemberName: ""
}

View File

@@ -1,8 +1,24 @@
import Entity from "./Entity"
export default class Integer extends Entity {
static attributes = {
value: 0
}
constructor(value) {
super()
this.value = Math.round(new Number(value).valueOf())
if (value?.constructor === String) {
value = Number(value)
}
if (value?.constructor === Number) {
value = {
value: Math.round(value.valueOf())
}
}
super(value)
}
getAttributes() {
return Integer.attributes
}
}

View File

@@ -0,0 +1,15 @@
import Entity from "./Entity"
export default class LocalizedTextEntity extends Entity {
static attributes = {
namespace: "",
key: "",
value: ""
}
getAttributes() {
return LocalizedTextEntity.attributes
}
}

View File

@@ -10,7 +10,7 @@ import VariableReferenceEntity from "./VariableReferenceEntity"
export default class ObjectEntity extends Entity {
static attributes = {
Class: "",
Class: ObjectReferenceEntity,
Name: "",
bIsPureFunc: new TypeInitialization(false, false),
VariableReference: new TypeInitialization(new VariableReferenceEntity(), false),

View File

@@ -3,7 +3,7 @@ import Entity from "./Entity"
export default class ObjectReferenceEntity extends Entity {
static attributes = {
type: "None",
type: "",
path: ""
}
@@ -12,6 +12,10 @@ export default class ObjectReferenceEntity extends Entity {
}
toString() {
return this.type + (this.path ? `'"${this.path}"'` : "")
return (this.type ?? "") + (
this.path
? this.type ? `'"${this.path}"'` : this.path
: ""
)
}
}

View File

@@ -2,11 +2,13 @@ import Entity from "./Entity";
import Guid from "../Guid";
import ObjectReferenceEntity from "./ObjectReferenceEntity";
import TypeInitialization from "./TypeInitialization";
import LocalizedTextEntity from "./LocalizedTextEntity";
export default class PinEntity extends Entity {
static attributes = {
PinId: Guid,
PinName: [new TypeInitialization(5, true), "ciao"],
PinName: "",
PinFriendlyName: new TypeInitialization(new LocalizedTextEntity(), false),
PinToolTip: "",
Direction: new TypeInitialization("", false),
PinType: {