jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

Allow computed group membership on types of subStates other than PlayerStates #769

Open jkomoros opened 4 years ago

jkomoros commented 4 years ago

Originally captured in #491

Currently you can only do computedPlayerGroupMembership on players (gameDelegate.GroupMembership() takes a playerstate). But there are some cases where you'd want similar machinery on game and even dynamiccomponentvalues.

Imagine a gameState.ActiveColor, for example.

You'd need a GameGroupMembership, and also need a ComputedGameGroupMembership.

And the verisons for dynamicComponentValues would need yet another, more complicated signature.