mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
18 lines
411 B
JavaScript
Executable File
18 lines
411 B
JavaScript
Executable File
import P from "parsernostrum"
|
|
import IntegerEntity from "./IntegerEntity.js"
|
|
|
|
export default class ByteEntity extends IntegerEntity {
|
|
|
|
static grammar = P.numberByte.map(v => new this(v))
|
|
|
|
get value() {
|
|
return super.value
|
|
}
|
|
set value(value) {
|
|
value = Math.trunc(value)
|
|
if (value >= 0 && value < 1 << 8) {
|
|
super.value = value
|
|
}
|
|
}
|
|
}
|