Fixed Roll form

This commit is contained in:
Stefan Zermatten
2019-09-26 11:29:46 +02:00
parent ba4cc1a496
commit 73f193460d
4 changed files with 109 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
import SimpleSchema from 'simpl-schema';
import { RollResultsSchema } from '/imports/api/properties/subSchemas/RollResultsSchema.js'
import RollResultsSchema from '/imports/api/properties/subSchemas/RollResultsSchema.js'
/**
* Rolls are children to actions or other rolls, they are triggered with 0 or
@@ -20,8 +20,8 @@ import { RollResultsSchema } from '/imports/api/properties/subSchemas/RollResult
* child rolls are applied
*/
let RollSchema = new SimpleSchema({
// The number to add to a d20 roll
rollBonus: {
// The roll
roll: {
type: String,
optional: true,
},

View File

@@ -2,6 +2,13 @@ import SimpleSchema from 'simpl-schema';
import ResultsSchema from '/imports/api/properties/subSchemas/ResultsSchema.js';
let RollResultsSchema = new SimpleSchema ({
_id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue(){
if (!this.isSet) return Random.id();
}
},
// Expression of whether or not to apply the roll
// Evaluates to an expression which gets compared to the roll
// or a number which the roll must equal
@@ -15,4 +22,4 @@ let RollResultsSchema = new SimpleSchema ({
},
});
export { RollResultsSchema };
export default RollResultsSchema ;