Skip to content

feat(werewolf-example): support customizing the number of each individual role(#299)#417

Merged
AlbumenJ merged 10 commits intoagentscope-ai:mainfrom
hujun-w-2:feat_player_count
Jan 1, 2026
Merged

feat(werewolf-example): support customizing the number of each individual role(#299)#417
AlbumenJ merged 10 commits intoagentscope-ai:mainfrom
hujun-w-2:feat_player_count

Conversation

@hujun-w-2
Copy link
Contributor

@hujun-w-2 hujun-w-2 commented Jan 1, 2026

…r of each individual role(#299)

AgentScope-Java Version

[The version of AgentScope-Java you are working on, e.g. 1.0.5, check your pom.xml dependency version or run mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]

Description

support customizing the number of each individual role(#299)
效果:
image
image

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

@hujun-w-2 hujun-w-2 requested review from a team and Copilot January 1, 2026 06:27
@cla-assistant
Copy link

cla-assistant bot commented Jan 1, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link

cla-assistant bot commented Jan 1, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for customizing the number of each individual role in the Werewolf game, addressing issue #299. Users can now configure the count of villagers, werewolves, seers, witches, and hunters through a new configuration modal in the UI.

Key Changes:

  • New GameConfiguration class: Encapsulates customizable role counts with validation logic
  • Backend refactoring: Modified GameState to support multiple instances of special roles (seers, witches, hunters) instead of single instances
  • UI configuration modal: Added a settings interface allowing users to customize role counts before starting a game

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
GameConfiguration.java New class that holds customizable role counts with validation
WerewolfWebController.java Accepts and validates role count parameters from the frontend
WerewolfWebGame.java Uses GameConfiguration to initialize games and handles multiple special role instances
GameState.java Refactored to store lists of seers/witches/hunters instead of single instances
index.html Added configuration modal UI with input fields for each role count
app.js Implements configuration modal logic and sends custom counts to backend
i18n.js Added translations for configuration UI labels in Chinese and English
style.css Added styling for the configuration modal and button

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AlbumenJ AlbumenJ changed the title support customizing the number of each individual role(#299) feat(werewolf-example): support customizing the number of each individual role(#299) Jan 1, 2026
@AlbumenJ AlbumenJ merged commit 1329ff4 into agentscope-ai:main Jan 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants