Commit 4203e177 authored by Joseph NISON--GUYON's avatar Joseph NISON--GUYON
Browse files

Mise à jour dans le diagramme de classes des classes/interfaces ts modifiées

Lien entre player-service.ts et PlayerProxy.java ajouté sur le diagramme
Vérification du joueur avant d'effectuer unee méthode de créature ou de traqué
parent ea9d172a
......@@ -127,65 +127,92 @@ interface Lieu.ts{
id: number
name: string
}
class GameProxy.ts {
survie: Array<CarteSurvie>
traque: Array<CarteTraque>
thriftClient: Client<CoreOptions>
createGame(number): Promise<number>
join(number): Promise<number>
piocherSurvie(number, number): CarteSurvie
piocherTraque(number, number): CarteTraque
avancerAssimilation(number): void | Promise<void>
placerCreature(number, Array<number>): void | Promise<void>
placerCible(number, Array<number>): void | Promise<void>
placerArtemia(number, Array<number>): void | Promise<void>
setLieu(number, number, Lieu): void | Promise<void>
setCarteSurvie(number, number, CarteSurvie.ts): void | Promise<void>
setCarteTraque(number, CarteTraque.ts): void | Promise<void>
wantRole(number, number, string): void | Promise<void>
rendDefausse(number, number, Array<number>): void | Promise<void>
askLieu(number, number, Lieu): void | Promise<void>
askCarteSurvie(number, number, CarteSurvie.ts): void | Promise<void>
askCarteTraque(number, CarteTraque.ts): void | Promise<void>
piocherReserve(number, number, Lieu): Promise<boolean> | void
defausserCarteSurvie(number, CarteSurvie.ts): void
defausserCarteTraque(number, CarteTraque.ts): void
createGame(numberOfPlayers: number): Promise<number>
join(gameId: number): Promise<number>
piocherSurvie(gameId: number, id: number): Promise<string>
piocherTraque(gameId: number): Promise<string>
avancerAssimilation(gameId: number): void | Promise<void>
placerCreature(gameId: number, lieux: Array<number>): void | Promise<void>
placerCible(gameId: number, lieux: Array<number>): void | Promise<void>
placerArtemia(gameId: number, lieux: Array<number>): void | Promise<void>
setLieu(gameId: number, playerId: number, lieu: number): void | Promise<void>
setCarteSurvie(gameId: number, playerId: number, carte: string): void | Promise<void>
setCarteTraque(gameId: number, carte: string): void | Promise<void>
wantRole(gameId: number, id: number, role: string): void | Promise<void>
rendDefausse(gameId: number, id: number, lieux: Array<number>): void | Promise<void>
askLieu(gameId: number, playerId: number, lieu: number): void | Promise<void>
askCarteSurvie(gameId: number, playerId: number, carte: string): void | Promise<void>
askCarteTraque(gameId: number, carte: string): void | Promise<void>
piocherReserve(gameId: number, id: number, lieu: number): Promise<boolean>
defausserCarteSurvie(gameId: number, carte: string): void
defausserCarteTraque(gameId: number, carte: string): void
}
class Playerservice.ts {
traque: Traque
creature: Creature
role: string
gameProxy: GameProxy
startGame(gameId: number): void
yourRole(role: string): void
getLieuxDefausse(): Array<number>
perdrePionsVolonte(): void
recupLieuxFromDefausse(cartes: Array<number>): void
lacherPrise(gameId: number): void
resister(gameId: number, cartes: Array<number>): void
piocherSurvie(gameId: number, id: number): void
piocherReserve(gameId: number, id: number, lieu: number): void
askCarteSurvie(gameId: number, id: number, carte: string): void
setCarteSurvie(gameId: number, id: number, carte: string): void
askLieu(gameId: number, id: number, lieu: number): void
setLieu(gameId: number, id: number, lieu: number): void
troisCartes(gameId: number): void
placerArtemia(gameId: number, lieux: Array<number>): void
placerCreature(gameId: number, lieux: Array<number>): void
placerCible(gameId: number, lieux: Array<number>): void
askCarteTraque(gameId: number, carte: string): void
setCarteTraque(gameId: number, carte: string): void
piocherTraque(gameId: number): void
}
class Traque.ts {
main: Array<number>
survie: Array<CarteSurvie>
mainSurvie: Array<CarteSurvie>
reserve: Array<Lieu>
defausse: Array<number>
gameProxy: GameProxy
volonte: number
getLieuxDefausse(): Array<number>
public getLieuxDefausse(): Array<number>
perdrePionsVolonte(): void | Promise<void>
recupLieuxFromDefausse(Array<Lieu.ts>): void | Promise<void>
lacherPrise(number): void | Promise<void>
resister(number, Array<Lieu.ts>): void | Promise<void>
piocherSurvie(number, number): Promise<void>
piocherReserve(number, number, Lieu.ts): Promise<void>
askCarteSurvie(number, number, CarteSurvie): void | Promise<void>
setCarteSurvie(number, number, CarteSurvie): void | Promise<void>
askLieu(number, number, Lieu.ts): void | Promise<void>
setLieu(number, number, Lieu.ts): void | Promise<void>
recupLieuxFromDefausse(cartes: Array<number>): void | Promise<void>
lacherPrise(gameId: number): void | Promise<void>
public resister(gameId: number, cartes: Array<number>): void | Promise<void>
piocherSurvie(gameId: number, id: number): Promise<void>
piocherReserve(gameId: number, id: number, lieu: number): Promise<void>
askCarteSurvie(gameId: number, playerId: number, carte: string): void | Promise<void>
setCarteSurvie(gameId: number, playerId: number, carte: string): void | Promise<void>
askLieu(gameId: number, playerId: number, lieu: number): void | Promise<void>
setLieu(gameId: number, playerId: number, lieu: number): void | Promise<void>
}
class Creature.ts {
main: Array<CarteTraque>
traque: Array<CarteTraque>
gameProxy: GameProxy
troisCartes(number): void | Promise<void>
placerArtemia(number, Array<number>): void | Promise<void>
placerCreature(number, Array<number>): void | Promise<void>
placerCible(number, Array<number>): void | Promise<void>
askCarteTraque(number, CarteTraque.ts): void | Promise<void>
setCarteTraque(number, CarteTraque.ts): void | Promise<void>
piocherTraque(number): Promise<void>
troisCartes(gameId: number): Promise<void>
placerArtemia(gameId: number, lieux: Array<number>): void | Promise<void>
placerCreature(gameId: number, lieux: Array<number>): void | Promise<void>
placerCible(gameId: number, lieux: Array<number>): void | Promise<void>
askCarteTraque(gameId: number, carte: string): void | Promise<void>
setCarteTraque(gameId: number, carte: string): void | Promise<void>
piocherTraque(gameId: number): Promise<void>
}
class Game {
......@@ -220,6 +247,7 @@ class GameServiceHandler {
GameProxy.ts "1" -- "1..6" Traque.ts
GameProxy.ts "1" -- "1" Creature.ts
PlayerProxy "1" -- "1" Playerservice.ts
GameInterface <|-- GameControlleur
Traque <|-- PlayerProxy
Creature <|-- PlayerProxy
......
......@@ -27,75 +27,112 @@ export class PlayerService implements IHandler<any> {
// méthodes des traqués
getLieuxDefausse(): Array<number> {
return this.traque.getLieuxDefausse();
if (this.role === 'Traqué') {
return this.traque.getLieuxDefausse();
}
return [];
}
perdrePionsVolonte(): void {
this.traque.perdrePionsVolonte();
if (this.role === 'Traqué') {
this.traque.perdrePionsVolonte();
}
}
recupLieuxFromDefausse(cartes: Array<number>): void {
this.traque.recupLieuxFromDefausse(cartes);
if (this.role === 'Traqué') {
this.traque.recupLieuxFromDefausse(cartes);
}
}
lacherPrise(gameId: number): void {
this.traque.lacherPrise(gameId);
if (this.role === 'Traqué') {
this.traque.lacherPrise(gameId);
}
}
resister(gameId: number, cartes: Array<number>): void {
this.traque.resister(gameId, cartes);
if (this.role === 'Traqué') {
this.traque.resister(gameId, cartes);
}
}
piocherSurvie(gameId: number, id: number): void {
this.traque.piocherSurvie(gameId, id);
if (this.role === 'Traqué') {
this.traque.piocherSurvie(gameId, id);
}
}
piocherReserve(gameId: number, id: number, lieu: number): void {
this.traque.piocherReserve(gameId, id, lieu);
if (this.role === 'Traqué') {
this.traque.piocherReserve(gameId, id, lieu);
}
}
askCarteSurvie(gameId: number, id: number, carte: string): void {
this.traque.askCarteSurvie(gameId, id, carte);
if (this.role === 'Traqué') {
this.traque.askCarteSurvie(gameId, id, carte);
}
}
setCarteSurvie(gameId: number, id: number, carte: string): void {
this.traque.setCarteSurvie(gameId, id, carte);
if (this.role === 'Traqué') {
this.traque.setCarteSurvie(gameId, id, carte);
}
}
askLieu(gameId: number, id: number, lieu: number): void {
this.traque.askLieu(gameId, id, lieu);
if (this.role === 'Traqué') {
this.traque.askLieu(gameId, id, lieu);
}
}
setLieu(gameId: number, id: number, lieu: number): void {
this.traque.setLieu(gameId, id, lieu);
if (this.role === 'Traqué') {
this.traque.setLieu(gameId, id, lieu);
}
}
// méthodes de la créature
troisCartes(gameId: number): void {
this.creature.troisCartes(gameId);
if (this.role === 'Créature') {
this.creature.troisCartes(gameId);
}
}
placerArtemia(gameId: number, lieux: Array<number>): void {
this.creature.placerArtemia(gameId, lieux);
if (this.role === 'Créature') {
this.creature.placerArtemia(gameId, lieux);
}
}
placerCreature(gameId: number, lieux: Array<number>): void {
this.creature.placerCreature(gameId, lieux);
if (this.role === 'Créature') {
this.creature.placerCreature(gameId, lieux);
}
}
placerCible(gameId: number, lieux: Array<number>): void {
this.creature.placerCible(gameId, lieux);
if (this.role === 'Créature') {
this.creature.placerCible(gameId, lieux);
}
}
askCarteTraque(gameId: number, carte: string): void {
this.creature.askCarteTraque(gameId, carte);
if (this.role === 'Créature') {
this.creature.askCarteTraque(gameId, carte);
}
}
setCarteTraque(gameId: number, carte: string): void {
this.creature.setCarteTraque(gameId, carte);
if (this.role === 'Créature') {
this.creature.setCarteTraque(gameId, carte);
}
}
piocherTraque(gameId: number): void {
this.creature.piocherTraque(gameId);
if (this.role === 'Créature') {
this.creature.piocherTraque(gameId);
}
}
}
......@@ -47,7 +47,7 @@ export class Traque {
return tab;
}
perdrePionsVolonte(): void | Promise<void> {
public perdrePionsVolonte(): void | Promise<void> {
this.volonte--;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment