Ok, I will try to do my best to explain how it works, don't hesitate to ask questions if it's not clear.
The game is compose of really simple element (information flow, wifi, virus, switch, and the spider) that are just describe by a position and sometime a state. they are store in proxies.
Once we have to calculate the next round state (and the animations to display for the transition) we use commands.
We do steps of calculation, a proxy keep the state of this and a macro command ask for each game element to interact. Each game element have a simple command where he know how to interact with others elements. For exemple :
- the information flow know that if the spider is at the entrance, he have to move it to the end
- the spider know that if it arrive on a wifi, it switchs it off
This command dispatch notification to the corresponding mediators that stacks internally the appropriate animation to play (and when to play it)
At the end we dispatch a notification "play the first step", we wait for everyone saying it's done and then dispatch "play the next" etc.
I think this system is flexible and allow us to add new game elements. The difficulty is that we have a list of element that can interact with all the other so it makes big switch/case in the command but it's the interesting part of the game : simple component that are coupled and make a complicated reflection game