Changed how levels are handled
This commit is contained in:
22
rpg-docs/Model/Character/Classes.js
Normal file
22
rpg-docs/Model/Character/Classes.js
Normal file
@@ -0,0 +1,22 @@
|
||||
Classes = new Meteor.Collection("classes");
|
||||
|
||||
Schemas.Class = new SimpleSchema({
|
||||
charId: {type: String, regEx: SimpleSchema.RegEx.Id},
|
||||
name: {type: String, trim: false},
|
||||
level: {type: Number},
|
||||
createdAt: {
|
||||
type: Date,
|
||||
autoValue: function() {
|
||||
if (this.isInsert) {
|
||||
return new Date;
|
||||
} else if (this.isUpsert) {
|
||||
return {$setOnInsert: new Date};
|
||||
} else {
|
||||
this.unset();
|
||||
}
|
||||
}
|
||||
},
|
||||
color: {type: String, allowedValues: _.pluck(colorOptions, "key"), defaultValue: "q"}
|
||||
});
|
||||
|
||||
Classes.attachSchema(Schemas.Class);
|
||||
Reference in New Issue
Block a user