Skip to content

#363 Replace magic numbers in Renderer._draw_dice with named constants - #410

Open
ahmedmajid22 wants to merge 1 commit into
mainfrom
363-magic-numbers-renderer-draw-dice
Open

ahmedmajid22 wants to merge 1 commit into
mainfrom
363-magic-numbers-renderer-draw-dice

Conversation

@ahmedmajid22

Copy link
Copy Markdown
Collaborator

Description

Replace magic numbers in Renderer._draw_dice with named constants in constants.py.

Related Issue

Closes #363

Changes

  • Added DICE_COUNT_ROW_COLLECTED, DICE_COUNT_ROW_ROLLED, DICE_SCORE_ROW_INDEX, DICE_HOVER_OFFSET, DICE_HOVER_BORDER_WIDTH, DICE_HOVER_BORDER_RADIUS to constants.py and all
  • Replaced all magic numbers in Renderer._draw_dice and _draw_dice_counts with the new constants
  • Removed unused type: ignore[override] comment in pickomino.py

Testing

  • Tests added/updated
  • Passes pre-commit hooks
  • Test coverage maintained (95%+)

@jarl-hoyem jarl-hoyem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

DICE_SCORE_ROW_INDEX seems strange? Needs explanation or reverse.
Again leave out type ignore

This branch has not been deployed

No deployments
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.

Method Renderer:_draw_dice uses magic numbers instead of named constants

2 participants