implemented UI for new parenting
This commit is contained in:
@@ -16,14 +16,14 @@ Containers.attachSchema(Schemas.Container);
|
||||
Containers.helpers({
|
||||
totalValue: function(){
|
||||
var value = this.value;
|
||||
Items.find({container: this._id, equipped: false}, {fields: {quantity: 1, value: 1}}).forEach(function(item){
|
||||
Items.find({"parent.id": this._id}, {fields: {quantity: 1, value: 1}}).forEach(function(item){
|
||||
value += item.totalValue();
|
||||
});
|
||||
return value;
|
||||
},
|
||||
totalWeight: function(){
|
||||
var weight = this.weight;
|
||||
Items.find({container: this._id, equipped: false}, {fields: {quantity: 1, weight: 1}}).forEach(function(item){
|
||||
Items.find({"parent.id": this._id}, {fields: {quantity: 1, weight: 1}}).forEach(function(item){
|
||||
weight += item.totalWeight();
|
||||
});
|
||||
return weight;
|
||||
|
||||
Reference in New Issue
Block a user