Skip to content

Commit

Permalink
Merge pull request #16 from the-hideout/add-item-attributes
Browse files Browse the repository at this point in the history
Initial implementation of item attributes
  • Loading branch information
Razzmatazzz authored Apr 2, 2022
2 parents 0932d49 + 927f6a5 commit dc622ed
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions datasources/barters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ class BartersAPI {
item: itemsAPI.getItem(itemData.id),
count: itemData.count,
quantity: itemData.count,
attributes: itemData.attributes
};
}),
rewardItems: barter.rewardItems.map((itemData) => {
return {
item: itemsAPI.getItem(itemData.id),
count: itemData.count,
quantity: itemData.count,
attributes: []
};
})
});
Expand Down
2 changes: 2 additions & 0 deletions datasources/crafts.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class CraftsAPI {
item: itemsAPI.getItem(itemData.id),
count: itemData.count,
quantity: itemData.count,
attributes: []
};
}),
rewardItems: craft.rewardItems.map((itemData) => {
return {
item: itemsAPI.getItem(itemData.id),
count: itemData.count,
quantity: itemData.count,
attributes: []
};
})
});
Expand Down
1 change: 1 addition & 0 deletions datasources/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class ItemsAPI {
item: this.formatItem(this.itemCache[containedItem.itemId]),
count: containedItem.count,
quantity: containedItem.count,
attributes: []
};
});
}
Expand Down
6 changes: 6 additions & 0 deletions schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,16 @@ module.exports = `
value: Int
}
type ItemAttribute {
type: String!
value: String
}
type ContainedItem {
item: Item!
count: Float!
quantity: Float!
attributes: [ItemAttribute]
}
type Barter {
Expand Down

0 comments on commit dc622ed

Please sign in to comment.