I'm just programming a Minecraft Redstone Simulator for Android. I'm doing the simulation with some variations of Dijkstra, but I heard, that the real simulator does something different and updates every redstone block every r开发者_如何学Pythonedstone tick.
How is notch doing it?
Update I know that he uses a HashSet, this doesn't look like Dijkstra, does it?
I will call anything that's redstone-related a "redstone block".
Every tick, Minecraft iterates through the hashset and updates each redstone block.
When more redstone blocks are added, the hashset size is increased, and everything that was in the previous, smaller hashset is scrambled into a random order.
精彩评论