-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbattleforhill.view.php
39 lines (31 loc) · 1.01 KB
/
battleforhill.view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once(APP_BASE_PATH . "view/common/game.view.php");
/**
* @property BattleForHill $game
*/
class view_battleforhill_battleforhill extends game_view
{
public function getGameName()
{
return "battleforhill";
}
public function build_page($viewArgs)
{
global $g_user;
$this->page->begin_block("battleforhill_battleforhill", "player_cards");
$currentPlayerId = (int) $g_user->get_id();
$players = $this->game->loadPlayersBasicInfos();
$this->tpl['YOUR_HAND'] = self::_('Your hand');
// Spectator
if (!isset($players[$currentPlayerId])) {
$this->tpl['GAME_CONTAINER_CLASS'] = '';
return;
}
if ($players[$currentPlayerId]['player_color'] !== BattleForHill::DOWNWARD_PLAYER_COLOR) {
$this->tpl['GAME_CONTAINER_CLASS'] = 'viewing-as-upwards-player';
} else {
$this->tpl['GAME_CONTAINER_CLASS'] = '';
}
$this->page->insert_block('player_cards');
}
}