Hearthstone

免费
通过 omgvamp | 已更新 vor 23 Tagen | Entertainment
人气

9.7 / 10

延迟

2,275ms

服务等级

100%

Health Check

N/A

返回所有讨论

All Cards Without Set

Rapid account: Vkapadia
vkapadia
vor 8 Jahren

Is it possible to have an endpoint or option that would return all cards (filterable by Collectible, of course) that’s not separated by set?

Rapid account: Strican
strican Commented vor 7 Jahren

I agree with OP. It’s totally doable on the client side, but the documentation suggests that the /cards endpoint returns a flat list of cards, each of which has a field for the card set anyway. If anything, the API should return a list of {set, cards} objects so that consumers can provide strict type definitions. As it is, each new set requires a new field definition since the set name is being used as the property name. Does that make sense?

Rapid account: Jim Moyle
JimMoyle Commented vor 8 Jahren

Get all cards, iterate available sets, loop through sets and create a new list, should be fairly easy client side.

Rapid account: Vkapadia
vkapadia Commented vor 8 Jahren

I’m not sure if there is another way to do it or not (I’m pretty new to this). My issue is that right now I have a class that I deserialize the JSON into. The class contains “IList<Card> Basic” and “IList<Card> Classic” and “IList<Card> Naxxramas” and so on. Basically I have a new IList for each set. This is not a huge problem now, but the issue is that when the set list changes (new sets are added), I have to update the app to accommodate it, or else I don’t get the new cards.

Rapid account: Omgvamp
omgvamp Commented vor 8 Jahren

Could you explain the benefit of this versus looping through it on your end?

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论