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

Rarity query #210

Merged
merged 3 commits into from
Feb 28, 2024
Merged

Rarity query #210

merged 3 commits into from
Feb 28, 2024

Conversation

lxgr-linux
Copy link
Member

No description provided.

@lxgr-linux lxgr-linux self-assigned this Feb 10, 2024
Copy link
Member

@patrickwieth patrickwieth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a side note:
I have seen sometimes our blockchain logs print arrays with numbers that are hard to make any use of :D
looks like [123] [467] ...

- name: owner
in: query
required: false
type: string
- name: cardType
- name: statuses
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why plural? a card can only have 1 status right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but dont u query a list of cards?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh yes, but you can only specify 1 status? So what you say is like "Give me all cards with status "permanent".
Example from real life:
You want to buy 4 apples, the apples are plural, then the nice lady in the marketplace asks you "Which sort of apples do you want?", then you yell "BOSKOP". The lady does not ask "Which sorts of apples do you want?"

@@ -14,27 +14,83 @@ var _ = strconv.Itoa(0)

func CmdQCards() *cobra.Command {
cmd := &cobra.Command{
Use: "q-cards [owner] [status] [card-type] [classes] [sort-by] [name-contains] [keywords-contains] [notes-contains] [startercards-only] [balance-achors-only]",
Use: "q-cards [owner] [statuses] [card-types] [classes] [rarities] [sort-by] [name-contains] [keywords-contains] [notes-contains] [startercards-only] [balance-achors-only]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question for card-type? A card can only have 1 type, so why is it plural?

default:
states = []types.Status{types.Status(types.Status_value[req.Status.String()])}
}
fmt.Printf("---> Hier: %#v\n", req)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug print important for production?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huuch

if bool(cardobjClass.Culture) != strings.Contains(req.Classes, "Culture") {
return false
}
fmt.Printf("%v, %v\n", cardobjClass, req.Classes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug print?

@lxgr-linux lxgr-linux merged commit 3858f28 into development Feb 28, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants