Skip to content

Commit

Permalink
feat: Add get_all_actions() function to board.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Apr 9, 2024
1 parent 8186a45 commit 98499a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/game/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class Action(Enum):
""" Move the block one step down """


def get_all_actions() -> list[Action]:
return [
Action.MOVE_LEFT,
Action.MOVE_RIGHT,
Action.ROTATE_CLOCKWISE,
Action.ROTATE_COUNTERCLOCKWISE,
Action.HARD_DROP,
Action.SOFT_DROP,
]


class Board:
"""
Represents the Tetris game board, handling block placements, movements, and rotations, as well as checking for game over conditions.
Expand Down

0 comments on commit 98499a7

Please sign in to comment.