Changed how effects are applied and removed to enable effects expiring after a set duration.

This commit is contained in:
Thaum
2014-11-17 13:48:46 +00:00
parent 8aa2e6485b
commit 0d648cc873
11 changed files with 103 additions and 85 deletions

View File

@@ -7,7 +7,7 @@ Schemas.Effect = new SimpleSchema({
type: String,
regEx: SimpleSchema.RegEx.Id,
autoValue: function(){
if(!isSet) return Random.id();
if(!this.isSet) return Random.id();
}
},
name: {
@@ -22,14 +22,4 @@ Schemas.Effect = new SimpleSchema({
type: String,
optional: true
}
});
Effect = function(name, value){
this._id = Random.id();
this.name = name;
if (typeof value === "string"){
this.calculation = value;
} else if (typeof valye === "number"){
this.value = value;
}
};
});