Closed wovalle closed 7 years ago
Deeply related to https://github.com/werewolfrd/werewolf-brain/issues/33
@mamodom How many levels of calls are we adding?
I have the impression that moderator.getScriptFromDeck
should return* every possible calls, but provide metadata for the clients to be able to filter.
*
I imagine this should probably be an opt-in or opt-out feature, that way clients that won't implement script filtering win't have to worry about this
The way I imagine this working is:
Background:
Given all the existing cards are
| Name | Bindings |
| Villager | |
| Werewolf | werewolves |
| Seer | seer |
| Cupid | cupid, lovebirds |
| Direwolf | dire_wolf, werewolves |
| Doppelganger | doppelganger |
| Big Bad Wolf | big_bad_wolf, werewolves |
| Cult Leader | cult_leader |
And I start a game from the following roles
| Name |
| Villager |
| Werewolf |
| Cult Leader |
| Seer |
| Cupid |
And then resulting game includes the following roles
| Name |
| Villager |
| Werewolf |
| Cult Leader |
Scenario: Game script filter
When I select the game level script filter
Then the moderator script is expected to have the following calls
| CallName | First Night | Decoy |
| cult_leader | No | No |
| werewolves | No | No |
Scenario: Deck script filter
When I select the deck level filter
Then the moderator script is expected to have the following calls
| CallName | First Night | Decoy |
| Cupid | Yes | Yes |
| lovebirds | Yes | Yes |
| cult_leader | No | No |
| werewolves | No | No |
| seer | No | Yes |
Scenario: No script filter
When I select no filter
Then the moderator script is expected to have the following calls
| CallName | First Night | Decoy |
| big_bad_wolf | Yes | Yes |
| cupid | Yes | Yes |
| lovebirds | Yes | Yes |
| doppelganger | Yes | Yes |
| dire_wolf | Yes | Yes |
| cult_leader | | No |
| werewolves | | No |
| seer | | Yes |
Scenario: Custom Filter
When I select the following custom filter
| Role |
| Werewolf |
| Seer |
| Doppelganger |
| Big Bad Wolf |
| Cult Leader |
Then the moderator script is expected to have the following calls
| CallName | First Night | Decoy |
| big_bad_wolf | Yes | Yes |
| doppelganger | Yes | Yes |
| cult_leader | | No |
| werewolves | | No |
| seer | | Yes |
@mamodom I'm with you, but by default I would return the results with game filter applied unless I receive another filter as param.
That's what I meant with
I imagine this should probably be an opt-in or opt-out feature, that way clients that won't implement script filtering win't have to worry about this
@mamodom Yeah, but the `Scenario: No script filter' should return the game filtered at game level.
I'm not getting what you're saying