2017-10-01 20:24:35 +02:00
|
|
|
import {Injectable} from "@angular/core";
|
|
|
|
import {AppConfig} from "../../app.config";
|
|
|
|
import {HttpClient} from "../http-client";
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class PlayerService {
|
|
|
|
|
|
|
|
constructor(private http: HttpClient,
|
|
|
|
private config: AppConfig) {
|
|
|
|
}
|
|
|
|
|
|
|
|
getCampaignPlayer(campaignId: string, playerName: string) {
|
2017-12-22 07:56:26 +01:00
|
|
|
return this.http.get(this.config.apiPlayersPath + '/single/' + campaignId + '/' + playerName)
|
2017-10-01 20:24:35 +02:00
|
|
|
.map(res => res.json())
|
|
|
|
}
|
|
|
|
|
2017-12-23 11:19:08 +01:00
|
|
|
getCampaignHighscore(campaignId: string) {
|
|
|
|
return this.http.get(this.config.apiPlayersPath + '/ranking/' + campaignId)
|
|
|
|
.map(res => res.json())
|
|
|
|
}
|
|
|
|
|
2017-10-01 20:24:35 +02:00
|
|
|
}
|
|
|
|
|