Denormalized some calculations into recomputation step
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js';
|
||||
|
||||
// These are the rolls made when saves are called for
|
||||
// For the saving throw bonus or proficiency, see ./Skills.js
|
||||
@@ -18,4 +19,22 @@ let SavingThrowSchema = new SimpleSchema ({
|
||||
},
|
||||
});
|
||||
|
||||
export { SavingThrowSchema };
|
||||
const ComputedOnlySavingThrowSchema = new SimpleSchema({
|
||||
dcResult: {
|
||||
type: Number,
|
||||
optional: true,
|
||||
},
|
||||
dcErrors: {
|
||||
type: Array,
|
||||
optional: true,
|
||||
},
|
||||
'dcErrors.$':{
|
||||
type: ErrorSchema,
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedSavingThrowSchema = new SimpleSchema()
|
||||
.extend(SavingThrowSchema)
|
||||
.extend(ComputedOnlySavingThrowSchema);
|
||||
|
||||
export { SavingThrowSchema, ComputedOnlySavingThrowSchema, ComputedSavingThrowSchema };
|
||||
|
||||
Reference in New Issue
Block a user