-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtakaraisland.action.php
179 lines (151 loc) · 4.03 KB
/
takaraisland.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
*------
* BGA framework: (c) Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
* takaraisland implementation : (c) Antonio Soler <morgald.es@gmail.com>
*
* 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.
* -----
*
* takaraisland.action.php
*
* takaraisland main action entry point
*
*
* In this file, you are describing all the methods that can be called from your
* user interface logic (javascript).
*
* If you define a method "myAction" here, then you can call it from your javascript code with:
* this.ajaxcall( "/takaraisland/takaraisland/myAction.html", ...)
*
*/
class action_takaraisland extends APP_GameAction
{
// Constructor: please do not modify
public function __default()
{
if( self::isArg( 'notifwindow') )
{
$this->view = "common_notifwindow";
$this->viewArgs['table'] = self::getArg( "table", AT_posint, true );
}
else
{
$this->view = "takaraisland_takaraisland";
self::trace( "Complete reinitialization of board game" );
}
}
// defines your action entry points there
/*
Example:
public function myAction()
{
self::setAjaxMode();
// Retrieve arguments
// Note: these arguments correspond to what has been sent through the javascript "ajaxcall" method
$arg1 = self::getArg( "myArgument1", AT_posint, true );
$arg2 = self::getArg( "myArgument2", AT_posint, true );
// Then, call the appropriate method in your game logic, like "playCard" or "myAction"
$this->game->myAction( $arg1, $arg2 );
self::ajaxResponse( );
}
*/
public function rentsword()
{
self::setAjaxMode();
$this->game->rentsword();
self::ajaxResponse();
}
public function dig()
{
self::setAjaxMode();
$this->game->dig();
self::ajaxResponse();
}
public function viewdone()
{
self::setAjaxMode();
$this->game->viewdone();
self::ajaxResponse();
}
public function cancel()
{
self::setAjaxMode();
$this->game->cancel();
self::ajaxResponse();
}
public function revealmonster()
{
self::setAjaxMode();
$this->game->revealmonster();
self::ajaxResponse();
}
public function survey()
{
self::setAjaxMode();
$this->game->survey();
self::ajaxResponse();
}
public function buy()
{
self::setAjaxMode();
$this->game->buy();
self::ajaxResponse();
}
public function sell()
{
self::setAjaxMode();
$token_id = self::getArg( "token_id", AT_posint, true );
$this->game->sell($token_id);
self::ajaxResponse();
}
public function choosereward()
{
self::setAjaxMode();
$reward = self::getArg( "reward", AT_posint, true );
$this->game->choosereward($reward);
self::ajaxResponse();
}
public function movetile()
{
self::setAjaxMode();
$tile = self::getArg( "tile", AT_posint, true );
$destination = self::getArg( "destination", AT_alphanum, true );
$this->game->movetile($tile,$destination);
self::ajaxResponse();
}
public function pickexpert()
{
self::setAjaxMode();
$expertpicked = self::getArg( "expertpicked", AT_alphanum, true );
$this->game->pickexpert($expertpicked);
self::ajaxResponse();
}
public function selectcards()
{
self::setAjaxMode();
$deckpicked = self::getArg( "deckpicked", AT_alphanum, true );
$token_id = self::getArg( "token_id", AT_posint, false );
$this->game->selectcards($deckpicked,$token_id);
self::ajaxResponse();
}
public function recruit()
{
self::setAjaxMode();
$this->game->recruit();
self::ajaxResponse();
}
public function payhospital()
{
self::setAjaxMode();
$this->game->payhospital();
self::ajaxResponse();
}
public function finish()
{
self::setAjaxMode();
$this->game->finish();
self::ajaxResponse();
}
}