Kinda off topic -- more of a question about undo implementation -- but...
If I (1) do something that causes a shuffle, then (2) undo to before the shuffle, then (3) cause the shuffle to happen again, does the second shuffle shuffle the cards the same way as the first? And if so, what things that I do between (2) and (3) changes it? E.g. I imagine gaining a card completely changes the shuffle (but not sure), whereas taking a coin token or whatever would not affect it.
The game (currently) uses 1 random number generator instance. It's not used a lot in dominion; mostly for shuffling.
Suppose you buy a Silver, end your turn, shuffle | undo, buy a village, end your turn, shuffle
-> the village will just take the place of the silver, the rest of the shuffle will be identical.
Suppose you buy a Silver, end your turn, shuffle | undo, buy a Port, gain another Port, end your turn, shuffle
-> the number of cards in the shuffle has changed. This will lead to a completely new shuffle.
Suppose you buy a Silver, end your turn, shuffle | undo, buy a Noble Brigand, give your opponent a Copper, end your turn, shuffle
-> the Noble Brigand will just take the place of the silver, the rest of the shuffle will be identical.
Suppose you buy a Silver, end your turn, shuffle | undo, buy a Noble Brigand, give your opponent a Copper and make them shuffle, end your turn, shuffle
-> the random numbers that were supposed to determine your shuffle now determine your opponents; yours comes after and will be completely new.