Type initialization using objects

This commit is contained in:
barsdeveloper
2023-01-02 00:22:50 +01:00
parent d391480f2c
commit 984bf32b51
43 changed files with 1511 additions and 831 deletions

View File

@@ -3,9 +3,19 @@ import IEntity from "./IEntity"
export default class RotatorEntity extends IEntity {
static attributes = {
R: Number,
P: Number,
Y: Number,
R: {
value: 0,
},
P: {
value: 0,
},
Y: {
value: 0,
},
}
static {
this.cleanupAttributes(this.attributes)
}
constructor(values) {
@@ -14,4 +24,16 @@ export default class RotatorEntity extends IEntity {
/** @type {Number} */ this.P
/** @type {Number} */ this.Y
}
getRoll() {
return this.R
}
getPitch() {
return this.P
}
getYaw() {
return this.Y
}
}