As a way to dog-food Sharpee, I’m porting mainframe Zork. One of the current questions is how events are processed. My original implementation didn’t consider NPC’s and then I implemented a refactor that isn’t right.
I had to create sequence diagrams to find the root issues and a way around it. We can’t have events handle direct world model mutations. All mutations must go through the stdlib package. I landed on events returning a list of effects that are validated and handled by an effects processor within the stdlib.
So you have events return a list of things they’d like to change. But then what happens if these cannot be applied to the world. Is the rest of the list aborted? In which case, how does an event handler effect list express;