diff --git a/README.md b/README.md index 18e8ba4..5c159ab 100644 --- a/README.md +++ b/README.md @@ -63,10 +63,8 @@ Create a new database and user, for example: ``` $ sudo -iu postgres $ psql -# CREATE DATABASE "hanab-live"; -# \c hanab-live # CREATE USER hanabi WITH PASSWORD 'Insert password here'; -# ALTER DATABASE "hanab-live" OWNER TO hanabi; +# CREATE DATABASE "hanab-live" with owner "hanabi"; ``` Put the connection parameters in a config file (for the format, see `example_config.yaml`). This should be located at your system default for the application `hanabi-suite`, diff --git a/hanabi/hanab_game.py b/hanabi/hanab_game.py index 08d00f8..0783f21 100644 --- a/hanabi/hanab_game.py +++ b/hanabi/hanab_game.py @@ -287,6 +287,12 @@ class GameState: # Utilities + def is_playable(self, card: DeckCard): + return self.stacks[card.suitIndex] + 1 == card.rank + + def is_trash(self, card: DeckCard): + return self.stacks[card.suitIndex] >= card.rank + def holding_players(self, card): for (player, hand) in enumerate(self.hands): if card in hand: diff --git a/requirements.txt b/requirements.txt index cf70c11..af32b12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,3 +10,4 @@ verboselogs pebble platformdirs PyYAML +cython==0.29.36