Commit 4f5b1e9d authored by sunye's avatar sunye
Browse files

Merge MR 'montée de tonnerre'

parents db423724 1a75a69a
......@@ -9,6 +9,7 @@ target
# dependencies
node_modules
node
package-lock.json
# IDEs and editors
/.idea
......
......@@ -2,7 +2,7 @@
NOT ALONE est un jeu asymétrique opposant un joueur (la Créature) aux autres joueurs (les Naufragés).
Si vous incarnez l’un des Naufragés, vous explorerez Artemia au moyen de cartes Lieux. Aidés de vos cartes Survie, vous tenterez de résister à la traque de la Créature jusquà l’arrivée des secours.
Si vous incarnez l’un des Naufragés, vous explorerez Artemia au moyen de cartes Lieux. Aidés de vos cartes Survie, vous tenterez de résister à la traque de la Créature jusqu'à l’arrivée des secours.
......@@ -28,7 +28,6 @@ Vous n’êtes pas seul...
== Project Layout
The current source code organization is based on the following article:
https://frakton.com/utilizing-maven-front-end-plugin-for-angular-spring-boot/
== Livrables attendus
......@@ -49,7 +48,7 @@ Découpage de la solution en composants (ou sous-systèmes) et spécification de
Moyens::
Utilisez des diagrammes d'interaction (séquence, communication) pour décrire l'échange de messages entre les composants pour en déduire leurs interfaces.
=== Conception détaillé
=== Conception détaillée
Objectif::
Spécification détaillée des composants: leur structure (diagramme de classes de conception), ainsi que le comportement de chaque opération fournie par le composants. Le comportement peut-être décrit en utilisant les diagrammes d'activité, d'interaction, les machines d'état, ainsi que OCL.
......@@ -75,4 +74,3 @@ Les critères qui seront utilisés pour évaluer le travail rendu son les suivan
* La cohérence entre la conception et le code.
* La qualité du code.
......@@ -3,10 +3,137 @@ namespace js common
exception InvalidOperationException {
1: i32 code,
2: string description
2: string message
}
exception GameNotFound {
1: i32 code,
2: string description
2: string message
}
struct Response{
1: bool state,
2: string message
}
struct TCard {
1: string cardType,
2: string cardName,
3: list<TPair> attributes
}
struct TJeton{
1: string symbol
}
struct TBoard {
1: string board
}
struct TColor {
1: string color
}
struct TPositionJeton{
1: list<string> position
}
struct TPlacedJeton{
1: TJeton jeton,
2: TPositionJeton position
}
struct TPhase {
1: string name
}
struct TPair {
1: string key,
2: string value
}
struct TAction {
1: string type,
2: list<TPair> params
}
struct TAskAction {
1: string type,
2: string message,
3: list<TPair> choices
}
struct TPlayerTeam{
1: string type
}
struct THand{
1: list<TCard> cards,
2: list<TCard> visibleCards,
3: list<TJeton> jetons,
4: i32 numberPionVolonte,
5: list<TCard> defausse,
}
struct TScore{
1: i32 traqueScore,
2: i32 creatureScore,
3: TBoard boardDistribution,
4: TColor boardColor
}
struct TPlacedCard{
1: TCard card,
2: string place
}
struct TBalise{
1: string type,
2: i32 state
}
struct TPlanet{
1: list<TPlacedCard> placedCard,
2: list<TPlacedJeton> jetons,
3: TBalise balise
}
struct TCardReserve{
1: TCard card,
2: i32 number
}
struct TTraque{
1: string name,
2: list<TCard> visibleCards,
3: i32 hiddenPlaceCardNumber,
4: list<TCard> defausse,
5: i32 hiddenSurvivalCardNumber,
6: i32 numberPionVolonte
}
struct TCreature{
1: string name,
2: list<TCard> visibleCards,
3: i32 hiddenTrackingCardNumber,
4: list<TJeton> jetons
}
struct TGameVariable{
1: string name,
2: list<TPair> values
}
struct TDescription{
1: TPlayerTeam team,
2: THand hand,
3: TScore score,
4: TPlanet planet
5: list<TCardReserve> reserve,
6: list<TGameVariable> variables,
7: list<TTraque> traquesInformation,
8: TCreature creatureInformation
}
......@@ -7,9 +7,38 @@ struct JoinRequest {
1: string name
}
struct TPlayer {
1: string token,
2: string name,
3: string address,
4: i32 port
}
struct TRoomId {
1: string token
}
//Service
service GameService {
i32 createGame(i32 numberOfPlayers)
TRoomId createRoom(TPlayer player) throws (1:common.InvalidOperationException e)
common.Response sendStartGame(TPlayer player, i32 creatureId, common.TBoard board, common.TColor color, list<common.TCard> placeCards)
common.Response joinRoom(TPlayer player, TRoomId roomId)
common.TDescription getGameDescription(TPlayer player)
void sendFinishPhase(TPlayer player, common.TPhase phase)
void sendPlayCards(TPlayer player, list<common.TCard> playerCards)
void sendPlaceJetons(TPlayer player, list<common.TPlacedJeton> placedJetons)
void sendResist(TPlayer player, i32 number)
void sendGiveUp(TPlayer player)
i32 join(i32 gameId, JoinRequest request) throws (1:common.GameNotFound e)
}
......@@ -3,6 +3,25 @@ include "common.thrift"
namespace java fr.univnantes.alma.thrift
namespace js common
//Service
service PlayerService {
void startGame(i32 gameId)
bool ping() throws (1:common.InvalidOperationException e)
void sendGameDescription(common.TDescription gameDescription)
void sendGameStart()
void sendGameIsFinished(common.TPlayerTeam winner)
void sendFirstRoundStart()
void sendStartPhase(common.TPhase phase, common.TDescription gameDescription)
common.TAction askAction(common.TAskAction askedAction)
void sendAction(common.TAskAction askedAction)
void sendResponse(common.Response response)
}
......@@ -47,9 +47,6 @@
</goals>
<configuration>
<backend>pdf</backend>
<!--
<sourceHighlighter>coderay</sourceHighlighter>
-->
<attributes>
<sourceHighlighter>coderay</sourceHighlighter>
<icons>font</icons>
......
= Conception préliminaire
== Liste des fonctions de l'interface Client-Serveur
=== Game Service
- createRoom(player : TPlayer) : TRoomId
- joinRoom(player : TPlayer, roomId : TRoomId) : Response
- sendStartGame(player : TPlayer, creatureId : Integer, board : TBoard, color : TColor, placeCards : Tcards[*]) : Response
- getGameDescription(player : TPlayer) : TDescription
- sendFinishPhase(player : TPlayer, phase : TPhase) : void
- sendPlayCards(player : TPlayer, playerCards : TCard[*]) : void
- sendPlaceJetons(player : TPlayer, placedJetons : TPlacedJeton[*]) : void
- sendResist(player : TPlayer, number : Integer) : void
- sendGiveUp(player : TPlayer) : void
=== Player Service
- sendGameDescription(gameDescription : TDescription) : void
- sendGameStart(): void
- sendGameIsFinished(common.TPlayerTeam winner) : void
- sendFirstRoundStart() : void
- sendStartPhase(phase : TPhase, gameDescription : TDescription) : void
- askAction(askedAction : TAskAction) : TAction
- sendAction(askedAction : TAskAction) : void
- sendResponse(response : Response) : void
== Components diagram
- Not alone (Joueur, Créature, Traqué, Main, Carte, Pioche, Réserve, Planète, Partie, Pouvoir)
- Base de données (Sauvegarde de joueurs)
- Authentificateur (SecurityWrapper)
- Client
== Components diagram
[plantuml, components-diagram, png]
....
hide circle
skinparam monochrome true
component GameService as na
component GameClient as c
database DataBase as db
component SecurityWrapper as sw
interface Data as dbi
interface GameService as nai
interface Security as swi
interface PlayerService as ci
c - ci
nai - na
na .> "use" swi
c .> "use" nai
na ..> "use" ci
dbi - db
swi - sw
sw .> "use" dbi
....
=== Interface
[plantuml, interface-diagrams, png]
....
hide circle
skinparam monochrome true
class "«interface» \n Data" as dbi{
existUser(id : String):Boolean
findUser(id : String):User
findPlaceCard(id : String):PlaceCard
findPlaceCards(ids : String[*]):PlaceCard[*]
findSurvivalCard(id : String):SurvivalCard
findSurvivalCards(ids : String[*]):SurvivalCard[*]
findAllSurvivalCards():SurvivalCard[*]
findTrackingCard(id : String):TrackingCard
findTrackingCards(ids : String[*]):TrackingCard[*]
findAllTrackingCards():TrackingCard[*]
}
class "«interface» \n Security" as swi{
verifyUser(id : String, password : String):Boolean
generateToken(id : String , gameId : String):String
getUser(id : String):User
}
class "«interface» \n GameService" as si{
createRoom(player : TPlayer) : TRoomId
joinRoom(player : TPlayer, roomId : TRoomId) : Response
sendStartGame(player : TPlayer, creatureId : Integer, board : TBoard, color : TColor, placeCards : Tcards[*]) : Response
getGameDescription(player : TPlayer) : TDescription
sendFinishPhase(player : TPlayer, phase : TPhase) : void
sendPlayCards(player : TPlayer, playerCards : TCard[*]) : void
sendPlaceJetons(player : TPlayer, placedJetons : TPlacedJeton[*]) : void
sendResist(player : TPlayer, number : Integer) : void
sendGiveUp(player : TPlayer) : void
}
class "«interface» \n PlayerService" as csi{
sendGameDescription(gameDescription : TDescription) : void
sendGameStart(): void
sendGameIsFinished(common.TPlayerTeam winner) : void
sendFirstRoundStart() : void
sendStartPhase(phase : TPhase, gameDescription : TDescription) : void
askAction(askedAction : TAskAction) : TAction
sendAction(askedAction : TAskAction) : void
sendResponse(response : Response) : void
}
....
== Diagrammes de séquence
== Diagramme de séquence de mise en place
- TPlayer tPlayer1 = {"Jean", "192.168.1.12:4200"}
- TPlayer tPlayer2 = {"Sébastien", "192.168.1.13:4200"}
Couleur partie : Bleu
[plantuml]
----
hide circle
skinparam monochrome true
C1Client -> S1Serveur : createRoom(tPlayer1)
C1Client <-- S1Serveur : 1001
C2Client -> S1Serveur : joinGame(tPlayer2, 1001)
C2Client <-- S1Serveur : {true, ""}
C1Client -> S1Serveur : sendStartGame(tPlayer1, 1, "PLATEAU_RECTO_ID", "Bleu", [Nexus, Jungle, Rivière, Dôme, Plage, Mangrove , Abri, Epave, Fungi, Portail])
C1Client <-- S1Serveur : {true, ""}
S1Serveur ->> C1Client : sendFirstRoundStart()
S1Serveur ->> C2Client : sendFirstRoundStart()
C1Client -> S1Serveur : getGameDescription(tPlayer1)
C1Client <-- S1Serveur : gameDescription
C2Client -> S1Serveur : getGameDescription(tPlayer2)
C2Client <-- S1Serveur : gameDescription
----
=== Diagramme de séquence du déroulement d'une manche
- TPlayer tPlayerTraque = {"Jean", "192.168.1.12:4200"}
- TPlayer tPlayerCreature = {"Sébastien", "192.168.1.13:4200"}
[plantuml]
----
hide circle
skinparam monochrome true
C1Client <<-- S1Serveur : sendStartPhase("PREPHASE_1", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PREPHASE_1", {GameDescription})
C1Client --> S1Serveur : sendResist(tPlayerTraque, 1)
C1Client <-- S1Serveur : {true, ""}
C1Client --> S1Serveur : sendPlayCards(tPlayerTraque, ["Adrenaline"])
C1Client <-- S1Serveur : {true, ""}
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PREPHASE_1")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PREPHASE_1")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PHASE_1", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PHASE_1", {GameDescription})
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PHASE_1")
C2Client <-- S1Serveur : {true, ""}
C1Client --> S1Serveur : sendPlayCards(tPlayerTraque, ["La_Plage"])
C1Client <-- S1Serveur : {true, ""}
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PHASE_1")
C1Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("POSTPHASE_1", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("POSTPHASE_1", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "POSTPHASE_1")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "POSTPHASE_1")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PREPHASE_2", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PREPHASE_2", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PREPHASE_2")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendPlayCards(tPlayerCreature, ["Soif_de_sang"])
C2Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PREPHASE_2")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PHASE_2", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PHASE_2", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PHASE_2")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendPlaceJetons(tPlayerCreature, "{{"Creature", "Place_1"}, {"Cible", "Place_7"}}")
C2Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PHASE_2")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("POSTPHASE_2", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("POSTPHASE_2", {GameDescription})
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "POSTPHASE_2")
C2Client <-- S1Serveur : {true, ""}
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "POSTPHASE_2")
C1Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PREPHASE_3", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PREPHASE_3", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PREPHASE_3")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PREPHASE_3")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PHASE_3", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PHASE_3", {GameDescription})
C1Client <- S1Serveur : askAction({"CHOOSE_POWER" ,"Choose a power",[{"1", "Power 1"}, {"2", "Power 2"}]})
C1Client --> S1Serveur : {"CHOOSE_POWER", ["1"]}
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PHASE_3")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PHASE_3")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("POSTPHASE_3", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("POSTPHASE_3", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "POSTPHASE_3")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "POSTPHASE_3")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PREPHASE_4", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PREPHASE_4", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PREPHASE_4")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PREPHASE_4")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("PHASE_4", {GameDescription})
C2Client <<-- S1Serveur : sendStartPhase("PHASE_4", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "PHASE_4")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "PHASE_4")
C2Client <-- S1Serveur : {true, ""}
C1Client <<-- S1Serveur : sendStartPhase("POSTPHASE_4", "GameDescription")
C2Client <<-- S1Serveur : sendStartPhase("POSTPHASE_4", {GameDescription})
C1Client --> S1Serveur : sendFinishPhase(tPlayerTraque, "POSTPHASE_4")
C1Client <-- S1Serveur : {true, ""}
C2Client --> S1Serveur : sendFinishPhase(tPlayerCreature, "POSTPHASE_4")
C2Client <-- S1Serveur : {true, ""}
----
== Création d'une partie
.Join game
......
......@@ -29,7 +29,11 @@ None so far.
// Provide a short description of the software being specified and its purpose, including relevant benefits, objectives, and goals. Relate the software to corporate goals or business strategies. If a separate vision and scope document is available, refer to it rather than duplicating its contents here.
<<<<<<< HEAD
The software system to be produced is a simplified version of the Hearthstone online game, which will be referred to as «{project}» thorough this document.
=======
The software system to be produced is a simplified version of the Hearthstone online room, which will be referred to as «{project}» thorough this document.
>>>>>>> E175362L/projet-2020-master
The {project} system will allow players from different locations to confront each-other in short and intensive games.
......@@ -49,9 +53,15 @@ The rest of this document contains an overall description of the {project} softw
=== Product Perspective
<<<<<<< HEAD
Hearthstone is a card game where two players confront each-other.
The {project} software should allow players that are connected to the Internet to use their connected devices to play.
Thus, «{project}» is an online, electronic version of the card game.
=======
Hearthstone is a card room where two players confront each-other.
The {project} software should allow players that are connected to the Internet to use their connected devices to play.
Thus, «{project}» is an online, electronic version of the card room.
>>>>>>> E175362L/projet-2020-master
While the system is distributed and organized in different components, players should perceive it as a single piece of software.
Figure <<deployment>> presents the overall architecture of the software.
......@@ -87,7 +97,11 @@ Server -up- Database : JPA
The {project} software must provide two main functions:
<<<<<<< HEAD
. Game creation: allowing two players to discover each other and start a game.
=======
. Game creation: allowing two players to discover each other and start a room.
>>>>>>> E175362L/projet-2020-master
. Game play: allowing players to actually play {project} until the victory of one of them.
// Summarize the major functions the product must perform or must let the user perform. Details will be provided in Section 3, so only a high level summary (such as a bullet list) is needed here. Organize the functions to make them understandable to any reader of the SRS. A picture of the major groups of related requirements and how they relate, such as a top level data flow diagram or object class diagram, is often effective.
......@@ -157,7 +171,11 @@ The client part of the software must operate on web browsers, whereas the server
// Describe the requirements associated with any communications functions required by this product, including e-mail, web browser, network server communications protocols, electronic forms, and so on. Define any pertinent message formatting. Identify any communication standards that will be used, such as FTP or HTTP. Specify any communication security or encryption issues, data transfer rates, and synchronization mechanisms.
<<<<<<< HEAD
Communications between the client and the game server must use Websockets.
=======
Communications between the client and the room server must use Websockets.
>>>>>>> E175362L/projet-2020-master
[#features]
== System Features
......@@ -168,7 +186,11 @@ Communications between the client and the game server must use Websockets.
// Don’t really say “System Feature 1.” State the feature name in just a few words.
<<<<<<< HEAD
The {project} software must allow the setup of a game with two players and automatically prepare and distribute cards.
=======
The {project} software must allow the setup of a room with two players and automatically prepare and distribute cards.
>>>>>>> E175362L/projet-2020-master
==== Description and Priority
......@@ -198,7 +220,11 @@ See Chapter <<domain>> (domain analysis) for further details.
=== Performance Requirements}
<<<<<<< HEAD
. The game must be _playable_, meaning that users must have fast feedback for their actions and delays due to communications/connection problems must be correctly held.
=======
. The room must be _playable_, meaning that users must have fast feedback for their actions and delays due to communications/connection problems must be correctly held.
>>>>>>> E175362L/projet-2020-master