Run the script to setup the development environment.
chmod +x setup.sh
./setup.sh
Note: ./setup.sh syncs these dependencies automatically when run,
pip-sync
pip-compile
When you need to use the game logic first thing import the game object
from game_logic.game import Game
after that instantiate an object of the class Game. This wil create a database in ram and the manage the game logic. You can access it using public 3 methods and 1 public attribute:
is a public attribute that contains a reference to the playing ground
Return a list of the four different players
Return a list of the cards contained in one place. By place are ment both the hands of the player and the ground
Require a card and a player. If the card is in the hand of the player the method will play it. If the card is not in the player hand it will raise an exception: "card not in player hand"
Return the points of Team one and Team Two as two int values. Before counting the points it check that each player played all the cards if is not the case throws an exception
Start the system first, requires Docker.
chmod +x run.sh
./run.sh
After that connect 4 clients by running the following 4 times in separate terminals:
chmod +x play.sh
./play.sh
You need to give a second or two for client to connect (this is still a working issue) Then you can play card with client and see what happens.