Giter VIP home page Giter VIP logo

sub's People

Contributors

0xavier avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sub's Issues

Add get_available_pids method in GameEngine

Write a method to get the list of pids corresponding to removable players. This method could be used by a player that wants to join the game.

Write documentation about this method in doc/game.md:removable players

Connect players to game

Change the way players connect to the game, to be consistant with the documentation (doc/general_architecture.md). More precisely, it should be:

game = GameEngine()
player = AIPlayer(0) # 0 is the player ID 
padapt = LocalPlayerAdapter(player) 
game.add_player(padapt)

Set cards of hands manually

Add the possibility to set cards manually for controlled players, in order to interface Players (AI or UI) with another instance of the game (for instance belote-en-ligne.fr).

Socket communication

Create a client and a server to dialog through sockets. The two main aims are:

  • Connect remotely players to a game
  • Connect remotely UI to a game

The general idea is described in doc/general_architecture.md.

A documentation should also be provided with implementation.

Create IUIAdapter

  • Create an adapter interface to define correctly the methods that a UIAdapter should implement.
  • UIAdapter should inherit from this interface.

Explicit imports

Add all imports needed in code snippets in the doc. For instance (from doc/general_architecture.md):

game = GameEngine()
evt = EventEngine()
game.connect_event_manager(evt)

should be:

from src.game.game_engine import GameEngine
from src.event.event_engine import EventEngine 

game = GameEngine()
evt = EventEngine()
game.connect_event_manager(evt)

Player adding in GameEngine

Use the add_player method in the GameEngine constructor to add default players instead of putting them in the list directly.

Set `is_removable` in kwargs to be explicit

The parameter ìs_removableinPlayerconstructor should be passed through kwargs for more clarity. Also add a default value toFalse`.

Example:
Player(0, is_removable=True) is clearer than Player(0, True).

Review interfaces

Some interfaces does not have the correct prefix (i_), e.g. console.py should be i_console.py.

  • Check that every interface has the correct prefix
  • Check that every method defined by an interface is decorated with @abstractmethod

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.