-
Notifications
You must be signed in to change notification settings - Fork 92
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
DestinyGameVersions returns some unexpected values #847
Labels
Comments
The docs say it’s a flags enum. You’ll need to use bitwise comparison. In very brief:
31 & 16 == TRUE (YearTwoAnnualPass)
15 & 8 == TRUE (Forsaken)
And:
15 & 16 == FALSE (no YearTwo pass)
But don’t just assume “greater than”, or else something like this will trip you up:
11 & 4 == FALSE (bitwise, 11 contains 1,2,8 but not 4)
There’s an FAQ for this somewhere in the docs, maybe linked from the main README.
… On Jan 2, 2019, at 18:57, edoxthebest ***@***.***> wrote:
I suppose black armory (ie, YearTwoAnnualPass) appears as "31", since this is what I obtained testing with different accounts, but the documentation says that it should be "16". The same behavior happens with Forsaken as it appears as "15" instead of "8". Is this something that is supposed to happen or did I get something wrong?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ah, beat me to the punch! Indeed, for more info check this out: https://github.com/Bungie-net/api/wiki/FAQ:-Flags-Enumerations,-how-do-they-work%3F |
Thorn, are you _easily_ able to change the wording “A flags enumeration” to “A bitfield flags enumeration” at .. everywhere that says ‘flags enumeration’? I know the bigger issues are issues, but since this is not localized text, we’d all benefit from “bitfield” and maybe even a second sentence “Use bitwise AND to test each flag against the API-returned value” there.
… On Jan 2, 2019, at 19:07, Vendal Thornheart ***@***.***> wrote:
Ah, beat me to the punch! Indeed, for more info check this out:
https://github.com/Bungie-net/api/wiki/FAQ:-Flags-Enumerations,-how-do-they-work%3F
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
(Or just outright link to that FAQ)
… On Jan 2, 2019, at 19:07, Vendal Thornheart ***@***.***> wrote:
Ah, beat me to the punch! Indeed, for more info check this out:
https://github.com/Bungie-net/api/wiki/FAQ:-Flags-Enumerations,-how-do-they-work%3F
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yeah, I could change that up - good call! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suppose black armory (ie, YearTwoAnnualPass) appears as "31", since this is what I obtained testing with different accounts, but the documentation says that it should be "16". The same behavior happens with Forsaken as it appears as "15" instead of "8". Is this something that is supposed to happen or did I get something wrong?
The text was updated successfully, but these errors were encountered: