diff --git a/app/imports/api/tabletop/TabletopObjects.js b/app/imports/api/tabletop/TabletopObjects.js new file mode 100644 index 00000000..ff42b0e3 --- /dev/null +++ b/app/imports/api/tabletop/TabletopObjects.js @@ -0,0 +1,43 @@ +import SimpleSchema from 'simpl-schema'; +import ChildSchema from '/imports/api/parenting/ChildSchema.js'; + +let TabletopObjects = new Mongo.Collection('tabletopObjects'); + +let TabletopObjectSchema = new SimpleSchema({ + name: { + type: String, + optional: true, + }, + texture: { + type: String, + regEx: SimpleSchema.RegEx.Id, + }, + 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; diff --git a/app/imports/client/ui/tabletop/TabletopMap.vue b/app/imports/client/ui/tabletop/TabletopMap.vue index 37546d7e..87eb8397 100644 --- a/app/imports/client/ui/tabletop/TabletopMap.vue +++ b/app/imports/client/ui/tabletop/TabletopMap.vue @@ -10,14 +10,19 @@