Compare commits
1 Commits
fa27f2c23b
..
0.2.5
| Author | SHA1 | Date | |
|---|---|---|---|
| 873bfe3bae |
@@ -44,3 +44,4 @@
|
|||||||
|
|
||||||
* build error ([51a363a](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/51a363a2432be111b804082df362975047dc8080))
|
* build error ([51a363a](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/51a363a2432be111b804082df362975047dc8080))
|
||||||
* NCWF-2 bugs and desing fixes ([#7](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/7)) ([c02414e](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/c02414ea40177b05a5e62dcf68dcb44efa6d3740))
|
* NCWF-2 bugs and desing fixes ([#7](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/7)) ([c02414e](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/c02414ea40177b05a5e62dcf68dcb44efa6d3740))
|
||||||
|
## [0.0.0](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/compare/0.2.4...0.0.0) (2026-06-01)
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
export interface Bot {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
rating: number;
|
|
||||||
createdAt: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BotWithToken extends Bot {
|
|
||||||
token: string;
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
export interface BotRef {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Clock {
|
|
||||||
limit: number;
|
|
||||||
increment: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Variant {
|
|
||||||
key: string;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResultDto {
|
|
||||||
rank: number;
|
|
||||||
points: number;
|
|
||||||
tieBreak: number;
|
|
||||||
bot: BotRef;
|
|
||||||
nbGames: number;
|
|
||||||
wins: number;
|
|
||||||
draws: number;
|
|
||||||
losses: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Standing {
|
|
||||||
page: number;
|
|
||||||
players: ResultDto[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Tournament {
|
|
||||||
id: string;
|
|
||||||
fullName: string;
|
|
||||||
clock: Clock;
|
|
||||||
variant: Variant;
|
|
||||||
rated: boolean;
|
|
||||||
nbPlayers: number;
|
|
||||||
nbRounds: number;
|
|
||||||
createdBy: string;
|
|
||||||
startsAt: string | null;
|
|
||||||
status: string;
|
|
||||||
round: number;
|
|
||||||
standing: Standing;
|
|
||||||
winner: BotRef | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TournamentList {
|
|
||||||
created: Tournament[];
|
|
||||||
started: Tournament[];
|
|
||||||
finished: Tournament[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Pairing {
|
|
||||||
id: string;
|
|
||||||
round: number;
|
|
||||||
white: BotRef | null;
|
|
||||||
black: BotRef;
|
|
||||||
gameId: string | null;
|
|
||||||
winner: string | null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoundPairings {
|
|
||||||
round: number;
|
|
||||||
pairings: Pairing[];
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { Bot, BotWithToken } from '../models/bot.models';
|
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
|
||||||
export class BotService {
|
|
||||||
private readonly http = inject(HttpClient);
|
|
||||||
private readonly base = '/api/account/official-bots';
|
|
||||||
|
|
||||||
list(): Observable<Bot[]> {
|
|
||||||
return this.http.get<Bot[]>(this.base);
|
|
||||||
}
|
|
||||||
|
|
||||||
create(name: string): Observable<BotWithToken> {
|
|
||||||
return this.http.post<BotWithToken>(this.base, { name });
|
|
||||||
}
|
|
||||||
|
|
||||||
delete(botId: string): Observable<void> {
|
|
||||||
return this.http.delete<void>(`${this.base}/${botId}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -40,7 +40,7 @@ export class GameApiService {
|
|||||||
? { white: playerInfo, black: botInfo }
|
? { white: playerInfo, black: botInfo }
|
||||||
: { white: botInfo, black: playerInfo };
|
: { white: botInfo, black: playerInfo };
|
||||||
|
|
||||||
return this.http.post<GameFull>(`${this.apiBase}${this.apiPath}/vs-bot`, payload);
|
return this.http.post<GameFull>(`${this.apiBase}${this.apiPath}`, payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
getGame(gameId: string): Observable<GameFull> {
|
getGame(gameId: string): Observable<GameFull> {
|
||||||
|
|||||||
@@ -1,50 +0,0 @@
|
|||||||
import { Injectable, inject } from '@angular/core';
|
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models';
|
|
||||||
|
|
||||||
export interface CreateTournamentForm {
|
|
||||||
name: string;
|
|
||||||
nbRounds: number;
|
|
||||||
clockLimitMinutes: number;
|
|
||||||
clockIncrement: number;
|
|
||||||
rated: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
|
||||||
export class TournamentService {
|
|
||||||
private readonly http = inject(HttpClient);
|
|
||||||
private readonly base = '/api/tournament';
|
|
||||||
|
|
||||||
list(): Observable<TournamentList> {
|
|
||||||
return this.http.get<TournamentList>(this.base);
|
|
||||||
}
|
|
||||||
|
|
||||||
get(id: string): Observable<Tournament> {
|
|
||||||
return this.http.get<Tournament>(`${this.base}/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
create(form: CreateTournamentForm): Observable<Tournament> {
|
|
||||||
const body = new URLSearchParams();
|
|
||||||
body.set('name', form.name);
|
|
||||||
body.set('nbRounds', String(form.nbRounds));
|
|
||||||
body.set('clockLimit', String(form.clockLimitMinutes * 60));
|
|
||||||
body.set('clockIncrement', String(form.clockIncrement));
|
|
||||||
body.set('rated', String(form.rated));
|
|
||||||
return this.http.post<Tournament>(this.base, body.toString(), {
|
|
||||||
headers: new HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded' })
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
start(id: string): Observable<Tournament> {
|
|
||||||
return this.http.post<Tournament>(`${this.base}/${id}/start`, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
join(id: string, botId: string, botName: string): Observable<void> {
|
|
||||||
return this.http.post<void>(`${this.base}/${id}/join`, { botId, botName });
|
|
||||||
}
|
|
||||||
|
|
||||||
roundPairings(id: string, round: number): Observable<RoundPairings> {
|
|
||||||
return this.http.get<RoundPairings>(`${this.base}/${id}/round/${round}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
MAJOR=0
|
MAJOR=0
|
||||||
MINOR=2
|
MINOR=2
|
||||||
PATCH=4
|
PATCH=5
|
||||||
|
|||||||
Reference in New Issue
Block a user