-
Notifications
You must be signed in to change notification settings - Fork 189
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
base: master
Are you sure you want to change the base?
Conversation
return [] if @corporate_action && @corporate_action.entity != entity | ||
|
||
actions = [] | ||
actions << 'take_loan' if @round.current_actions.none? && @game.can_take_loan?(entity) |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this 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
?).
Before clicking "Create"
master
docker compose exec rack rubocop -a
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
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.