Skip to content

Calculate the amount of gate and city based on the server's capacity#95

Open
InusualZ wants to merge 1 commit intodevfrom
calculate-gate-city-by-capacity
Open

Calculate the amount of gate and city based on the server's capacity#95
InusualZ wants to merge 1 commit intodevfrom
calculate-gate-city-by-capacity

Conversation

@InusualZ
Copy link
Copy Markdown
Collaborator

Exactly as the title say, compute the amount of city and gates based on the server's capacity.

@InusualZ InusualZ requested a review from sepalani March 18, 2023 23:34
Comment on lines +308 to +311
city_max_capacity = City.get_max_capacity(is_jap)
city_count = int(min(
math.ceil(capacity / city_max_capacity), Gate.MAX_CITY_PER_GATE))
capacity = city_count * city_max_capacity
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Won't this approach fail when many users decide to solo play (and not fill up the city)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, but even in that case there is not much that we can do, because there is a maximum amount of city per gate.

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