From a85504cc1c111b1040d0453efe7769170c3d5c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 2 Aug 2023 11:50:08 +0200 Subject: [PATCH] adjust README: easier setup of DB --- README.md | 4 +--- hanabi/hanab_game.py | 6 ++++++ requirements.txt | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) 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