Iterated on tabletop model
This commit is contained in:
@@ -17,33 +17,48 @@ const InitiativeSchema = new SimpleSchema({
|
||||
},
|
||||
activeCreature: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.id,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
|
||||
// All creatures in a tabletop have a shared time and space.
|
||||
let TabletopSchema = new SimpleSchema({
|
||||
// Details
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
imageUrl: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
|
||||
// Permissions by userId
|
||||
// Who owns this tabletop and can delete it
|
||||
owner: String,
|
||||
// The owner will need to included in one of these arrays for specific permissions
|
||||
// A user should not appear in more than one of the following arrays
|
||||
gameMasters: [String],
|
||||
players: [String],
|
||||
spectators: [String],
|
||||
// Does everyone else have the spectator permission?
|
||||
public: {
|
||||
type: Boolean,
|
||||
defaultValue: false,
|
||||
index: 1,
|
||||
},
|
||||
|
||||
// Initiative
|
||||
initiative: {
|
||||
type: InitiativeSchema,
|
||||
defaultValue: {},
|
||||
},
|
||||
gameMaster: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.id,
|
||||
},
|
||||
players: {
|
||||
type: Array,
|
||||
defaultValue: [],
|
||||
},
|
||||
'players.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.id,
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
Tabletops.attachSchema(TabletopSchema);
|
||||
|
||||
Reference in New Issue
Block a user