Moved properties out of creature folder, since they apply to library nodes as well now
This commit is contained in:
49
app/imports/api/properties/Containers.js
Normal file
49
app/imports/api/properties/Containers.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import schema from '/imports/api/schema.js';
|
||||
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
|
||||
import { PropertySchema } from '/imports/api/properties/Properties.js'
|
||||
import ChildSchema from '/imports/api/parenting/ChildSchema.js';
|
||||
|
||||
//set up the collection for containers
|
||||
let Containers = new Mongo.Collection("containers");
|
||||
|
||||
let ContainerSchema = schema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false
|
||||
},
|
||||
carried: {
|
||||
type: Boolean,
|
||||
defaultValue: true,
|
||||
optional: true,
|
||||
},
|
||||
contentsWeightless: {
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
weight: {
|
||||
type: Number,
|
||||
min: 0,
|
||||
defaultValue: 0
|
||||
},
|
||||
value: {
|
||||
type: Number,
|
||||
min: 0,
|
||||
defaultValue: 0
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
trim: false
|
||||
},
|
||||
});
|
||||
|
||||
ContainerSchema.extend(ColorSchema);
|
||||
|
||||
Containers.attachSchema(ContainerSchema);
|
||||
Containers.attachSchema(PropertySchema);
|
||||
Containers.attachSchema(ChildSchema);
|
||||
|
||||
export default Containers;
|
||||
export { ContainerSchema };
|
||||
Reference in New Issue
Block a user