poker-html-client
Version:
HTML client for online poker
47 lines (40 loc) • 1.87 kB
text/typescript
/// <reference path="../pageblock.ts" />
import { App } from "../app";
import { LobbyPage } from "./lobbypage";
import { TablesListPage } from "./tableslistpage";
import { TournamentLobbyPage } from "./tournamentlobbypage";
import { TournamentsListPage } from "./tournamentslistpage";
declare var app: App;
export class LobbyPageBlock extends PageBlock {
public sngListPage: TournamentsListPage;
public tournamentsListPage: TournamentsListPage;
public lobbyPage: LobbyPage;
public tournamentLobbyPage: TournamentLobbyPage;
public tablesListPage: TablesListPage;
constructor() {
const lobbyPage = new LobbyPage();
super("lobby", "filter", lobbyPage);
this.lobbyPage = lobbyPage;
this.tablesListPage = new TablesListPage();
this.addSecondary("tablesList", this.tablesListPage);
this.tournamentLobbyPage = new TournamentLobbyPage();
App.addTabBarItemMapping("lobby", "tournamentLobby");
this.addSecondary("tournamentLobby", this.tournamentLobbyPage);
this.tournamentsListPage = new TournamentsListPage();
App.addTabBarItemMapping("lobby", "tournamentsList");
this.addSecondary("tournamentsList", this.tournamentsListPage);
this.sngListPage = new TournamentsListPage();
App.addTabBarItemMapping("lobby", "sngList");
this.addSecondary("sngList", this.sngListPage);
this.addSecondary("lobby", this.lobbyPage, true);
this.currentPage = "lobby";
}
public showLobby() {
app.executeCommand("pageblock.lobby");
app.lobbyPageBlock.showSecondary("lobby");
}
public selectTournament(tournament) {
this.tournamentLobbyPage.setTournament(tournament.TournamentId, this.currentPage);
this.showSecondary("tournamentLobby");
}
}