Currently game state is being stored in a somewhat customized Agent. This PR moves that state into a fully custom, vanilla Genserver.
Agents are great for storing state, but the customization was necessary when I wanted to implement custom termination logic. And with this change, the logic between server and client is able to be more fully separated so that it's more obvious what is running in the server versus what is running in the LiveView (and later channel) process. This will allow me to create more formal boundaries between domains.
Currently game state is being stored in a somewhat customized Agent. This PR moves that state into a fully custom, vanilla Genserver.
Agents are great for storing state, but the customization was necessary when I wanted to implement custom termination logic. And with this change, the logic between server and client is able to be more fully separated so that it's more obvious what is running in the server versus what is running in the LiveView (and later channel) process. This will allow me to create more formal boundaries between domains.
Resolves #51