Plusieurs ajouts :
- Possibilité de configurer des lieux dans une scène : permet de configurer un donjon par exemple avec les pièces, les trésors par pièce, la narration..... Mise en place également de conditions permettant de conditionner le déblocage des quêtes. - Possibilité de transformé un arc en instance non linéaire afin de faire un hub. Permet de jouer de préparer des campagnes type Dragon of Icespire peak plus facilement. - Configuration de partie : chaque partie va contenir les séances, ce qui permettra de suivre le déblocage des conditions pour les quêtes. Passage en 0.9.1-beta
This commit is contained in:
44
web/src/app/services/playthrough.service.ts
Normal file
44
web/src/app/services/playthrough.service.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
import { Playthrough, PlaythroughCreate } from './campaign.model';
|
||||
|
||||
export interface PlaythroughDeletionImpact {
|
||||
sessions: number;
|
||||
characters: number;
|
||||
flags: number;
|
||||
progressions: number;
|
||||
}
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class PlaythroughService {
|
||||
|
||||
private apiUrl = '/api/playthroughs';
|
||||
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
listByCampaign(campaignId: string): Observable<Playthrough[]> {
|
||||
const params = new HttpParams().set('campaignId', campaignId);
|
||||
return this.http.get<Playthrough[]>(this.apiUrl, { params });
|
||||
}
|
||||
|
||||
getById(id: string): Observable<Playthrough> {
|
||||
return this.http.get<Playthrough>(`${this.apiUrl}/${id}`);
|
||||
}
|
||||
|
||||
create(payload: PlaythroughCreate): Observable<Playthrough> {
|
||||
return this.http.post<Playthrough>(this.apiUrl, payload);
|
||||
}
|
||||
|
||||
update(id: string, payload: Playthrough): Observable<Playthrough> {
|
||||
return this.http.put<Playthrough>(`${this.apiUrl}/${id}`, payload);
|
||||
}
|
||||
|
||||
delete(id: string): Observable<void> {
|
||||
return this.http.delete<void>(`${this.apiUrl}/${id}`);
|
||||
}
|
||||
|
||||
deletionImpact(id: string): Observable<PlaythroughDeletionImpact> {
|
||||
return this.http.get<PlaythroughDeletionImpact>(`${this.apiUrl}/${id}/deletion-impact`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user