Scrython icon indicating copy to clipboard operation
Scrython copied to clipboard

card_faces() should return a CardsObject

Open Jerakin opened this issue 4 years ago • 3 comments

Jerakin avatar Jun 25 '21 20:06 Jerakin

Is this a suggestion for functionality?

NandaScott avatar Jun 25 '21 21:06 NandaScott

Oh yeah sorry! Was going to write a description/user case but totally forgot!

In my case I first get a card with .Named then I take that object and pass it a long to some other functions that does their magic. But in the case of cards with multiple faces they don't have names and such. So before I do anything with it I have to check if it have faces, if it have faces I do things with the individual faces.

I would like to be able to use the same interface I have built for .Named for faces. Right now I am creating a dummy object that mimics the interface of a CardsObject to pass the json data to, which of course works. But seeing that a face is a card, it would be nice if it behaved similarily to one.

Jerakin avatar Jun 28 '21 11:06 Jerakin

Hmm. I see what you're saying. I think that would involve creating an even more generic class (something like CardFace) that then gets extended by CardsObject since there's a lot of property overlap. Then when we just return CardFace when we ask for a card face we return an array of those objects or the specific object if the index is specified.

I can see all of that being helpful. I'll try and find some time to add that but I can't guarantee anything.

NandaScott avatar Jun 29 '21 16:06 NandaScott