-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnowboarding.action.php
146 lines (130 loc) · 3.43 KB
/
nowboarding.action.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
*------
* BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
* Now Boarding implementation : © quietmint
*
* This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
* See http://en.boardgamearena.com/#!doc/Studio for more information.
* -----
*/
class action_nowboarding extends APP_GameAction
{
// Constructor: please do not modify
public function __default()
{
if ($this->isArg('notifwindow')) {
$this->view = 'common_notifwindow';
$this->viewArgs['table'] = $this->getArg('table', AT_posint, true);
} else {
$this->view = 'nowboarding_nowboarding';
$this->trace('Complete reinitialization of board game');
}
}
private function checkVersion()
{
$clientVersion = (int) $this->getArg('version', AT_int, false);
$this->game->checkVersion($clientVersion);
}
public function jsError()
{
$this->setAjaxMode(false);
$this->game->jsError($_POST['userAgent'], $_POST['msg']);
$this->ajaxResponse();
}
function undo()
{
$this->setAjaxMode();
$this->checkVersion();
$this->game->undo();
$this->ajaxResponse();
}
function vip()
{
$this->setAjaxMode();
$this->checkVersion();
$accept = $this->getArg('accept', AT_bool, true);
$this->game->vip($accept);
$this->ajaxResponse();
}
public function buy()
{
$this->setAjaxMode();
$this->checkVersion();
$type = $this->getArg('type', AT_alphanum, true);
$alliance = $this->getArg('alliance', AT_alphanum, false);
$this->game->buy($type, $alliance);
$this->ajaxResponse();
}
public function buyAgain()
{
$this->setAjaxMode();
$this->checkVersion();
$this->game->buyAgain();
$this->ajaxResponse();
}
public function pay()
{
$this->setAjaxMode();
$this->checkVersion();
$paid = explode(',', $this->getArg('paid', AT_numberlist, true));
$this->game->pay($paid);
$this->ajaxResponse();
}
public function prepareDone()
{
$this->setAjaxMode();
$this->checkVersion();
$this->game->prepareDone();
$this->ajaxResponse();
}
public function flyDone()
{
$this->setAjaxMode();
$this->checkVersion();
$snooze = boolval($this->getArg('snooze', AT_bool, false));
$this->game->flyDone($snooze);
$this->ajaxResponse();
}
public function flyAgain()
{
$this->setAjaxMode();
$this->checkVersion();
$this->game->flyAgain();
$this->ajaxResponse();
}
public function flyTimer()
{
$this->setAjaxMode();
$this->checkVersion();
$this->game->flyTimer();
$this->ajaxResponse();
}
public function move()
{
$this->setAjaxMode();
$this->checkVersion();
$from = $this->getArg('from', AT_alphanum, true);
$to = $this->getArg('to', AT_alphanum, true);
$this->game->move($from, $to);
$this->ajaxResponse();
}
public function board()
{
$this->setAjaxMode();
$this->checkVersion();
$paxId = $this->getArg('paxId', AT_int, true);
$paxPlayerId = $this->getArg('paxPlayerId', AT_int, false);
$this->game->board($paxId, $paxPlayerId);
$this->ajaxResponse();
}
public function deplane()
{
$this->setAjaxMode();
$this->checkVersion();
$paxId = $this->getArg('paxId', AT_int, true);
$paxPlayerId = $this->getArg('paxPlayerId', AT_int, false);
$this->game->deplane($paxId, $paxPlayerId);
$this->ajaxResponse();
}
}