Refactored computations again, split into multiple files, lots still to do

This commit is contained in:
Stefan Zermatten
2020-03-17 16:13:18 +02:00
parent 1a0c2bca78
commit 74fef2bd39
20 changed files with 636 additions and 640 deletions

View File

@@ -51,8 +51,7 @@ let SkillSchema = new SimpleSchema({
},
});
let ComputedSkillSchema = new SimpleSchema({
let ComputedOnlySkillSchema = new SimpleSchema({
// Computed value of skill to be added to skill rolls
value: {
type: Number,
@@ -80,16 +79,29 @@ let ComputedSkillSchema = new SimpleSchema({
allowedValues: [0, 0.5, 1, 2],
defaultValue: 0,
},
// Computed number of total conditional benefits
// Computed number of total conditional benefits
conditionalBenefits: {
type: SimpleSchema.Integer,
type: Array,
optional: true,
},
'conditionalBenefits.$': {
type: String,
},
// Computed number of things forcing this skill to fail
rollBonuses: {
type: Array,
optional: true,
},
'rollBonuses.$': {
type: String,
},
// Computed number of things forcing this skill to fail
fail: {
type: SimpleSchema.Integer,
optional: true,
},
}).extend(SkillSchema);
})
export { SkillSchema, ComputedSkillSchema };
let ComputedSkillSchema = ComputedOnlySkillSchema.extend(SkillSchema);
export { SkillSchema, ComputedSkillSchema, ComputedOnlySkillSchema };

View File

@@ -1,17 +1,10 @@
import SimpleSchema from 'simpl-schema';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
let SpellListSchema = new SimpleSchema({
name: {
type: String,
optional: true,
},
// The technical, lowercase, single-word name used in formulae
variableName: {
type: String,
regEx: VARIABLE_NAME_REGEX,
min: 3,
},
description: {
type: String,
optional: true,