Files
DiceCloud/app/imports/api/tabletop/TabletopObjects.js
2025-01-16 16:24:56 +02:00

44 lines
765 B
JavaScript

import SimpleSchema from 'simpl-schema';
import ChildSchema from '/imports/api/parenting/ChildSchema';
let TabletopObjects = new Mongo.Collection('tabletopObjects');
let TabletopObjectSchema = new SimpleSchema({
name: {
type: String,
optional: true,
},
texture: {
type: String,
max: 32,
},
position: {
type: Object,
optional: true,
},
'position.x': {
type: Number,
},
'position.y': {
type: Number,
},
width: {
type: Number,
},
height: {
type: Number,
},
rotation: {
type: Number,
max: 360,
min: 0,
},
});
const schema = new SimpleSchema({});
schema.extend(ChildSchema);
schema.extend(TabletopObjectSchema);
TabletopObjects.attachSchema(schema);
export default TabletopObjects;