Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate configuration before starting game #276

Open
Zomis opened this issue Dec 27, 2021 · 1 comment
Open

Validate configuration before starting game #276

Zomis opened this issue Dec 27, 2021 · 1 comment
Labels
dsl-core For improvements of the DSL approach to defining games enhancement New feature or request

Comments

@Zomis
Copy link
Owner

Zomis commented Dec 27, 2021

Allow rules to validate configuration.

Input: playerCount, GameConfigs
Output: List of rules, or list of strings that does not allow configuration

DSL Example:

val size = config("size") { 5 }
rule("test") {
    validateConfig { config.get(size) >= playerCount }
}
@Zomis Zomis added enhancement New feature or request dsl-core For improvements of the DSL approach to defining games labels Dec 27, 2021
@Zomis
Copy link
Owner Author

Zomis commented Jul 18, 2022

Example use-cases:

  • TTT, UTTT, Quixo, and all those kinds of games: m,n,k must be positive
  • Avalon: If you use Percival, then you must also use Merlin and/or Morgana
  • Liar's Dice: dice per player >= 1, exactly (or at most?) one of higher X any Y must be set
  • Skull: skulls >= 1, flowers >= 1
  • Splendor: maxMoney >= (min cost of starting cards), targetPoints >= 1
  • Hanabi:
    • Max clue tokens >= 1
    • max fail tokens >= 1
    • if only one card each of rainbow then also rainbow
    • If rainbow is all colors then also rainbow
  • Artax: x >= 4 and y >= 4
  • UR: pieces per player >= 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dsl-core For improvements of the DSL approach to defining games enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant