sigcatta / myshelfie Goto Github PK
View Code? Open in Web Editor NEWProva finale Ingegneria del Software 2023
License: Apache License 2.0
Prova finale Ingegneria del Software 2023
License: Apache License 2.0
If all the tiles on the board are isolated, the board is to be reffiled at the end of the turn
Server
Below is the list of technical requirements for the server side.
SocketClientHandler
deserializes the data sent by the client and sends them to the commandParser
the data consists in a HashMap<String, String> commandMap with the following keys: GAME_ID, NICKNAME, COMMAND_TYPE, COMMAD_DATA
The Action abstract class has the execute abstract method, each command needs it's own action:
Each execute method is able to convert the string of parameters into the real type parameters for the model
Each execute method is responsible to check if who sent the command can actually execute it (e.g. PICKUP_TILE is only available if the name of the player is equal to the name of the active player in game)
Call the corresponding methods in the model
CHAT
PICKUP_TILES
INSERT_TILES
CAN_I_PLAY
NEW_GAME ~ should create a new game and send NEW_GAME_OK if successfull
Test everything better trying to cover all cases
The class has a list of players and it's responsibility is to update each player's score
The class needs to:
use common goal methods to update the score at the end of each turn
calculate points based on the colors of the tiles in the shelf (at the end of the game)
calculate personal goals score (at the end of the game)
the player who complets their shelf first gains 1 extra point
Testing
A class who's job is to parse the client's commands to a Map that will be serialized and sent to the server
the server will then use the map as explained in #67
If a shelf is full, each player has to finish their turn, then the game is over
Client
Below is the list of technical requirements for the client side.
When a player connects:
Create a class with a single static method that checks if a list of tiles is valid for pickup
Implement support for reading JSON files via a ReadFromJSONFile class
Build tests for ReadFromJSONFile
Implement a card dealer class with the following methods:
public static List getCards(int numOfPlayers);
this method's only purpose is to return numOfPlayers cards when a game is created.
Build tests for PersonalCardDealer
Create a class for personal goal cards, it needs to have:
an HashMap for the colors and their coordinate
a method to check if the objectives are completed
Build tests for all the methods in PersonalGoals
Build all 12 json files
Build tests for all 12 files
Move the GamesManager class into the controller.
Substitute the commands that are currently String with enums.
The enum class must be equal in the client and server side to avoid compatibility issues
Implement a card dealer class with the following methods:
public static List getCards();
this method's only purpose is to return 2 cards when a game is created.
Create an abstract class for common goals, it needs to have:
a stack for point tiles
a list for players who already completed the goal
a method that returns points
Build all 12 extensions of the abstract class
refactoring -> each class has to use the same method from either an interface or an abstract class
Build tests for all 12 classes
implement the method ChangePlayerTurn in the class TurnHandler
Create the Shelf class, containing:
If all players but one disconnect, a timer starts and, if at the end of the timer there is still only one player left, that player is the winner and the game ends, if anyone reconnects at any time after the start of the timer, the timer stops and the game continues.
If all players disconnect the game ends
Instructions:
build a Player class + methods
test Player class
build a ShelfManager class + methods
test ShelfManager class
build a Shelf class + methods
test Shelf class
Instructions to parse:
build a ShelfBuffer class
test ShelfBuffer
Model
Server:
Client:
Cli:
Gui:
build a game menu containing:
build the commands the player needs to checkout other players shelfs and goal cards
build a command to refresh the console
build a starting menu where the player can try to join a game o create a new one
Section responsible for refilling the table with casual tiles.
Design pattern Command
Create class with method refillBoard() : void. The method is responsible for checking the amount of tiles needed to refill the board and refilling it using Command design pattern
Test
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.