Closed Kallin closed 10 years ago
One example is if several minions have deathrattle and they all die at the same time. The order of how deathrattle is executed is based upon the order of when the minions were played. So you can't just loop through each player's minions. You need to go through a list of all minions that are ordered by when they were played (FIFO) so you trigger the deathrattles in correct order.
Ah cool, I didn't know that was a rule of deathrattle, thanks :)
Yep, that's the reason. Also, this reminds me... the FIFO list should be used for other effects that happen simultaneously as well, e.g., end-of-turn effects and others. As it stands now, it is only used for deathrattles.
Cool, that might even come in handy knowing when I play sometimes :P I'm taking a look at the identitylinkedlist code again to see if I can remove that class so that's why I'm investigating.
What's the idea with the allMinionsFifoList. It looks to only be used by 'handleDeadMinons'. Is there a reason you couldn't just loop through each player's minions?