Iterated on tabletops

This commit is contained in:
Thaum Rystra
2024-06-12 17:30:37 +02:00
parent a5292cf0f2
commit 621f284cff
12 changed files with 210 additions and 56 deletions

View File

@@ -0,0 +1,13 @@
const MAX_PROP_COUNT = 10_000;
const MAX_CREATURE_COUNT = 110;
export function assertTabletopHasPropSpace(tabletop) {
if (tabletop.propCount >= MAX_PROP_COUNT) {
throw new Meteor.Error('tabletops.denied',
'This tabletop is full, either remove some creatures or reduce how many properties each creature has');
}
if (tabletop.creatureCount >= MAX_CREATURE_COUNT) {
throw new Meteor.Error('tabletops.denied',
'This tabletop is full, you can\'t add any more creatures to it');
}
}