tstats.inc.php - hadarawgs - Hadara adaptation for boardgamearena.com
(HTM) git clone git://git.z3bra.org/hadarawgs.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
tstats.inc.php (2930B)
---
1 <?php
2
3 /**
4 *------
5 * BGA framework: © Gregory Isabelli <gisabelli@boardgamearena.com> & Emmanuel Colin <ecolin@boardgamearena.com>
6 * hadarawgs implementation : © Willy Goiffon <dev@z3bra.org>
7 *
8 * This code has been produced on the BGA studio platform for use on http://boardgamearena.com.
9 * See http://en.boardgamearena.com/#!doc/Studio for more information.
10 * -----
11 *
12 * stats.inc.php
13 *
14 * hadarawgs game statistics description
15 *
16 */
17
18 /*
19 In this file, you are describing game statistics, that will be displayed at the end of the
20 game.
21
22 !! After modifying this file, you must use "Reload statistics configuration" in BGA Studio backoffice
23 ("Control Panel" / "Manage Game" / "Your Game")
24
25 There are 2 types of statistics:
26 _ table statistics, that are not associated to a specific player (ie: 1 value for each game).
27 _ player statistics, that are associated to each players (ie: 1 value for each player in the game).
28
29 Statistics types can be "int" for integer, "float" for floating point values, and "bool" for boolean
30
31 Once you defined your statistics there, you can start using "initStat", "setStat" and "incStat" method
32 in your game logic, using statistics names defined below.
33
34 !! It is not a good idea to modify this file when a game is running !!
35
36 If your game is already public on BGA, please read the following before any change:
37 http://en.doc.boardgamearena.com/Post-release_phase#Changes_that_breaks_the_games_in_progress
38
39 Notes:
40 * Statistic index is the reference used in setStat/incStat/initStat PHP method
41 * Statistic index must contains alphanumerical characters and no space. Example: 'turn_played'
42 * Statistics IDs must be >=10
43 * Two table statistics can't share the same ID, two player statistics can't share the same ID
44 * A table statistic can have the same ID than a player statistics
45 * Statistics ID is the reference used by BGA website. If you change the ID, you lost all historical statistic data. Do NOT re-use an ID of a deleted statistic
46 * Statistic name is the English description of the statistic as shown to players
47
48 */
49
50 $stats_type = array(
51
52 // Statistics global to table
53 "table" => array(
54
55 "turns_number" => array("id"=> 10,
56 "name" => totranslate("Number of turns"),
57 "type" => "int" ),
58
59 /*
60 Examples:
61 "table_teststat1" => array( "id"=> 10,
62 "name" => totranslate("table test stat 1"),
63 "type" => "int" ),
64
65 "table_teststat2" => array( "id"=> 11,
66 "name" => totranslate("table test stat 2"),
67 "type" => "float" )
68 */
69 ),
70
71 // Statistics existing for each player
72 "player" => array(
73
74 "turns_number" => array("id"=> 10,
75 "name" => totranslate("Number of turns"),
76 "type" => "int" ),
77
78 /*
79 Examples:
80 "player_teststat1" => array( "id"=> 10,
81 "name" => totranslate("player test stat 1"),
82 "type" => "int" ),
83
84 "player_teststat2" => array( "id"=> 11,
85 "name" => totranslate("player test stat 2"),
86 "type" => "float" )
87
88 */
89 )
90
91 );