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

[18FR] Share Redemption Round #11449

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Galatolol
Copy link
Contributor

Before clicking "Create"

  • Branch is derived from the latest master
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

Implementation Notes

Explanation of Change

In Stock Round, corporations can't redeem shares (contrarily to 1817). Instead, after SR, there is Share Redemption Round in which all companies with shares in market, going in decreasing price order, may take loans and redeem shares. After SRR share price is updated for sold out companies and shares in market.

After each SR in which a player owns any short share, they have their certificate limit increased by 1 for the rest of the game.

Screenshots, Problems

1

In SRR there is an unnecessary 'Buy Market Share' button which works exactly as 'Redeem 1' (and then you can click it again if you want to redeem more).

To not show this button, I think the def render_market_shares method should be modified.

@ollybh ollybh added new games Issues relating to games that are not yet alpha test level 18FR labels Jan 30, 2025
return [] if @corporate_action && @corporate_action.entity != entity

actions = []
actions << 'take_loan' if @round.current_actions.none? && @game.can_take_loan?(entity)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't call none? without a block, use empty? instead.

Suggested change
actions << 'take_loan' if @round.current_actions.none? && @game.can_take_loan?(entity)
actions << 'take_loan' if @round.current_actions.empty? && @game.can_take_loan?(entity)

Copy link
Collaborator

@ollybh ollybh left a comment

Choose a reason for hiding this comment

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

One minor fix needed, you have a call to Array.none? without passing a code block. This is more expensive than calling Array.empty?.

To remove the unnecessary 'Buy market share' button in the share redemption round, try adding a pool_shares method to G18FR::Step::RedeemShares. If that method returns an empty array then I think that should get rid of the button. If you're also getting buttons for any IPO shares then you might need to look at adding a can_buy? method to the step.

(Also, the variable @player_sr_with_short_count is not the most clear name. Could it be something simpler like @extra_certificates?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
18FR new games Issues relating to games that are not yet alpha test level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants