intro to software
CSE3310-002/003
Spring 2020
Project Description
Rev - 1/21/2020
Poker++
Introduction
This document describes the user requirements for the software system known as "Poker++". Poker++ (abbreviated, P++), is a collection of software programs that play 5 Card Draw Poker. (perhaps a bit optomistic; the dealer is automatic, each player is actually a human using a gui on a computer)
For more information on the game and the rules, please see this video:
https://www.youtube.com/watch?v=UmtSUhSfyYE
This document will be revised during the semester as needed. All revisions will be discussed in class and posted to Canvas.
Note that the interface described in this document is mandatory, and must be supported by the dealer and the player of every project group. The initial interface is 'notional'; expect it to be changed significantly as the development progresses. Groups that wish to make a change to the interface need to inform the instructor at the earliest possible time of any revisions.
This document is informational. It is a mix of requirements, constraints, and information provided by stakeholders of P++. All of the information provided is to be used to help develop the software requirements; not a statement of them.
User Requirements
The system will be client server. There will be one application called the 'dealer' and another called the 'player'. During game play one dealer will connect with at least one player. It is permissible to have more than one player during a game, with all players connected to the single dealer.
For communication purposes, the Boost ASIO library will be used. Specifically, a set of client server examples (the chat example), will be used as the basis for project. (Note 'asio' and 'boost asio' are essentially the same thing. Some header files are named differently, but the abstractions and interfaces are identical)
https://www.boost.org/doc/libs/1_68_0/doc/html/boost_asio/examples/cpp11_examples.html
Note that the specific boost version does not matter, as this library is mature and time tested. It is also available without boost as 'asio'; either version will work fine for this project.
Communication between the dealer and the player will be in accordance with a text based, JSON encoded, interface that is documented at the end of this document. Use of a common interface will allow dealers and players from different development groups to inter operate.
The library for converting to / from JSON will be :
https://github.com/nlohmann/json
It is a header only C++ library. This header can be checked into the projects source tree if desired.
The player program will have a gui interface. The gui will be done in gtk. (version: whichever you like best).
Characteristics of the player application:
· Easy tp use
· Delightful
· Responsive
· User Friendly
· Bounded memory usage
· Bounded CPU usage
The project will be code in C++11. It will be compiled by g++ and executed on a linux / unix system. (Note Using MacOS or Windows Subsystem for Linux is possible). But, the grading of the project will be done on a linux machine (Centos 7, g++ version 4.85). In general, any recent linux distribution with a C++11 compiler will be sufficient.
Every player needs a unique identifier. This is in addition to the players name. It is strongly suggested that a Boost UUID be used. If some other scheme is being used, a Boost UUID needs to be accommodated.
Each player is expected to receive all transmissions from the dealer in order to draw the state of the entire game.
The player application will have limited functionality, mainly as an interface to the user. All decisions about winning, losing, or game play will be made by the server.
Include requirements that will aid in testing the software system (like setting an environment variable to force the dealer to have a fixed sequence of cards).
Interface
From the client to the server:
{
"from": 123456-55-12345,
"action": "bet",
"amount": 123.0,
"replace_cards":["ace_spades","two_hearts","three_diamonds","queen_clubs","five_hearts"]
}
other valid actions are "check", "raise", "fold", or "call". the amount field is optional for some of the actions
the 'replace_cards' field is required only when the player wishes the dealer to replace the listed cards in his hand.
From the server to the client:
{
"to": 123456-55-12345,
"name":"Hank Hill",
"current_turn":3,
"table_position":1,
"cards": ["ace_spades","two_hearts","three_diamonds","queen_clubs","five_hearts"],
}