Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card with "?" ATK/DEF #152

Closed
orozso opened this issue Apr 6, 2020 · 5 comments
Closed

Card with "?" ATK/DEF #152

orozso opened this issue Apr 6, 2020 · 5 comments
Labels
api Issue related to the API

Comments

@orozso
Copy link

orozso commented Apr 6, 2020

Some card's ATK and DEF is "?", but this in the database/api "0".

Tip: Special value for "?" (e.g.: -1 (minus one))

e.g.: Slifer the Sky Dragon

@AlanOC91 AlanOC91 added the api Issue related to the API label Apr 6, 2020
@AlanOC91
Copy link
Owner

AlanOC91 commented Apr 6, 2020

I've been reluctant to do this for quite some time for a couple of reasons:

  • Changing it could cause issues for those using the API in calculations
  • I'm generally not a fan of storing negative integer values

I'll look into it a bit more but it's going to be an issue especially on an API level. If I store them as -1 and make -1 show as "?" in the API then this could cause issues for everyone using the API that are expecting an integer value.

@mvettosi
Copy link

You could add two new fields, for example:
{"is_atk_undefined": true/false, "is_def_undefined": true/false}
This way you should not break anything existing, and still giving the api users a way to display it correctly

@CAS-ual-TY
Copy link

Imo going for a negative integer here is the goto solution. It seems to be better than an extra field. Personally, I would not do this in v7, however, and rather do it in the next version (v8?) to make sure nothing is broken, because of - as you said - the calculators that use it.
When it comes to calculating, then a "?" has to be handled in a special way, anyways. Once the calculators would move on to the next theoretical version, then they could decide themselves how to do it and even just continue to handle "?" as a "0", if they want to.
Another solution I could think of is a request flag. Something like &showSpecialValues or similar, which you need to add to your request to indicate that you want these special values shown. Pre-existing API users would not be broken that way.

@CAS-ual-TY
Copy link

@AlanOC91 bumping this if you dont mind

@AlanOC91
Copy link
Owner

AlanOC91 commented Feb 8, 2022

Using &misc=yes will now show question_atk and/or question_def to be 1 for true if a card is found to have a ? in the data.

Thanks to Dot on discord for providing data for easy ingestion into our API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the API
Projects
None yet
Development

No branches or pull requests

4 participants