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

Implement returning all players points vs winner player colour #269

Open
lpoblet opened this issue Mar 28, 2024 · 1 comment
Open

Implement returning all players points vs winner player colour #269

lpoblet opened this issue Mar 28, 2024 · 1 comment

Comments

@lpoblet
Copy link

lpoblet commented Mar 28, 2024

I'm interested in generating player statistics randomly. It'd be much better for me to know the points of all players instead of the winner

@bcollazo
Copy link
Owner

bcollazo commented Apr 3, 2024

Hello lpoblet,

There is a state function called get_actual_victory_points (

def get_actual_victory_points(state, color):
) that you can call at the end of the game with the particular color you are interested in. You can also iterate over the colors in the game with game.state.colors.

This is similar to how the StatisticsAccumulator (catanatron_experimental/cli/accumulators.py) keeps track of several statistics and shows them at the end of a run when using the CLI. You could also register your own custom accumulator (https://github.com/bcollazo/catanatron/tree/master?tab=readme-ov-file#accumulators) depending on the need.

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

No branches or pull requests

2 participants