Files
ueblueprint/js/entity/ByteEntity.js
barsdeveloper 1c2778fbf8 Still WIP
2024-05-28 16:44:39 +02:00

14 lines
340 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))
set value(value) {
if (value % 1 == 0 && value >= 0 && value < 1 << 8) {
super.value = value
}
}
}