Hey @TeeTeeHaa, the Room in the client-side is supposed to expose all its useful events as callbacks (onLeave, onStateChange, etc), I might be wrong but I can't see an explicit advantage for declaring your own room class as opposed to doing what's provided & documented, such as:
try {
const room = await client.joinOrCreate<MyState>("room", {});
console.log("client joined!");
room.onLeave(() => console.log("client left!"));
room.onStateChange(() => console.log("state changed!"));
// (...schema callbacks)
room.state.players.onAdd = (player, key) => {/* ... */};
} catch (e) {
console.error(e.message);
}
You'd generally create your own wrapper for the room on the client-side, connecting its events with changes in your client's UI and representation of the game state.
If you have a better proposal for dealing with this on the client-side I'm all in, though. Just have to convince me and other team members :D