Timeline for Another try. List don't remove properly
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 30, 2021 at 14:07 | vote | accept | Dead Lord | ||
Jan 22, 2021 at 12:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Dec 23, 2020 at 12:08 | comment | added | Dead Lord | Let us continue this discussion in chat. | |
Dec 23, 2020 at 10:42 | answer | added | Dead Lord | timeline score: 1 | |
Dec 23, 2020 at 10:41 | comment | added | Dead Lord | Thank you m8 :) | |
Dec 23, 2020 at 10:37 | comment | added | Zibelas | Rather think about it early than late. Imagine you have a bord with tab abilities that you can use each round. If you have three times the same card, click on the second and the first one gets turned/ used, what would happen now if you click on the third? Is your logic resolver checking the first and sees it can't use the card? Or does it check the third but applies resolves to the first? | |
Dec 23, 2020 at 10:25 | comment | added | Dead Lord | No, it doesn't matter. Just for now I have not so many cards, so they casn't be the same. Just now. But maybe...if it's a game...maybe it IS matter...I didn't really think about it | |
Dec 23, 2020 at 10:22 | comment | added | Zibelas | You can use that for your id, but the List contains function does not know you want this or that it can use this as identifier. It should be as simple as override the Equals in your Card class and just return the cardsName. Another thing, if you have twice the same card, player uses the second, would it matter if the first gets remove? | |
Dec 23, 2020 at 10:20 | comment | added | Dead Lord |
@Zibelas oh! I see! Even if I have card.CardsData.cardsName it doesn't counts, right?
|
|
Dec 23, 2020 at 10:15 | comment | added | Zibelas | Basically contains does not know how to identify the correct card in your list since you didn't implement those. You can take a look at this stackoverflow.com/questions/2629124/… Your equals should return something that is unique for all your cards, like an id, name or a combination. | |
Dec 23, 2020 at 10:14 | comment | added | Dead Lord | @Zibelas no... What exactly should I do? | |
Dec 23, 2020 at 10:11 | history | edited | Dead Lord | CC BY-SA 4.0 |
added 1297 characters in body
|
Dec 23, 2020 at 10:11 | comment | added | Zibelas | Did you implement IEquatable or override Equals() and GetHashCode() in your Card class? | |
Dec 23, 2020 at 9:57 | history | asked | Dead Lord | CC BY-SA 4.0 |