Tests for various entity classes and update entity class implementations

This commit is contained in:
barsdeveloper
2024-06-03 00:11:30 +02:00
parent 5314228b33
commit 8fed17b20f
11 changed files with 309 additions and 210 deletions

View File

@@ -6,12 +6,11 @@ export default class NaturalNumberEntity extends IntegerEntity {
static grammar = P.numberNatural.map(v => new this(v))
get value() {
return super.value
}
set value(value) {
value = Math.round(Utility.clamp(this.value, 0))
super.value = value
}
constructor(value = 0) {
super(value)
}
}