+/*
+ * brisk - briskin5.phh
+ *
+ * Copyright (C) 2006-2011 Matteo Nastasi
+ * mailto: nastasi@alternativeoutput.it
+ * matteo.nastasi@milug.org
+ * web: http://www.alternativeoutput.it
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details. You should have received a
+ * copy of the GNU General Public License along with this program; if
+ * not, write to the Free Software Foundation, Inc, 59 Temple Place -
+ * Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+define('BIN5_PLAYERS_N', 3);
+define('BIN5_MAX_PLAYERS', BIN5_PLAYERS_N);
+// define(BIN5_SHM_MIN', (50000 * BIN5_MAX_PLAYERS));
+define('BIN5_SHM_MIN', 32768);
+define('BIN5_SHM_MAX', (BIN5_SHM_MIN + 1048576));
+define('BIN5_SHM_DLT', 32768);
+define('BIN5_PROXY_PATH', PROXY_PATH."/bin5");
+
+$mlang_bin5_bin5 = array(
+ 'info_part' => array( 'it' => '<hr>Nell\'ultima mano ha chiamato <b>%s</b>, il socio era <b>%s</b>,<br>',
+ 'en' => '<hr>In the last hand the declarer was <b>%s</b>, the partner was <b>%s</b>,<br>'),
+ 'info_capp' => array( 'it' => 'hanno fatto <b>cappotto</b> EBBRAVI!.<br>',
+ 'en' => 'and they made <b>capot</b> WELL DONE!.<br>'),
+ 'info_pnt' => array( 'it' => 'dovevano fare <b>%s</b> punti e ne hanno fatti <b>%d</b>: hanno %s.<br>',
+ 'en' => 'they had to do <b>%s</b> points and they had made <b>%d</b>: they have %s.<br>'),
+ 'info_alea' => array( 'it' => 'almeno ',
+ 'en' => 'at least '),
+ 'info_more' => array( 'it' => 'più di 60',
+ 'en' => 'over 60'),
+ 'info_win' => array( 'it' => '<b>vinto</b>',
+ 'en' => '<b>win</b>'),
+ 'info_peer' => array( 'it' => '<b>pareggiato</b>',
+ 'en' => '<b>drew</b>'),
+ 'info_lost' => array( 'it' => '<b>perso</b>',
+ 'en' => '<b>lost</b>'),
+
+ 'info_alon' => array( 'it' => '<hr>Nell\'ultima partita <b>%s</b> si è chiamato in mano,<br>',
+ 'en' => '<hr>In the last hand <b>%s</b> play alone against each other,<br>'),
+ 'info_apnt' => array( 'it' => 'doveva fare <b>%s</b> punti e ne ha fatti <b>%d</b>: ha %s.<br>',
+ 'en' => 'he/she had to do <b>%s</b> points and they had made <b>%d</b>: he/she had %s.<br>'),
+ 'info_acap' => array( 'it' => 'ha fatto <b>cappotto</b> EBBRAVO!.<hr>',
+ 'en' => 'and he/she made <b>capot</b> WELL DONE!.<hr>'),
+
+ 'info_omul' => array( 'it' => ' La partita valeva <b>%s</b>.',
+ 'en' => ' EN: The game was worth <b>%s</b>.' ),
+
+ 'info_yturn'=> array( 'it' => ' tocca a <b>te</b> giocare.',
+ 'en' => ' it\'s <b>your</b> turn.'),
+ 'info_turn' => array( 'it' => 'tocca a <b>%s</b> giocare.',
+ 'en' => 'it\'s the <b>%s</b>\'s turn.'),
+ 'info_mult' => array( 'it' => ' La partita vale <b>%s</b>.',
+ 'en' => ' The game worth <b>%s</b>.' ),
+ 'info_yshuf'=> array( 'it' => 'Fai <b>tu</b> il mazzo, ',
+ 'en' => 'It\'s <b>your</b> shuffled the cards, '),
+ 'info_shuf' => array( 'it' => 'Il mazzo a <b>%s</b>, ',
+ 'en' => '<b>%s</b> shuffled the cards, '),
+ 'btn_bkgame'=> array( 'it' => 'torna alla partita',
+ 'en' => 'back to the game'),
+ 'call_wptn' => array( 'it' => '<br>con %d punti',
+ 'en' => '<br>with %d points'),
+ 'call_ycall'=> array( 'it' => 'Chiami%s:',
+ 'en' => 'Call%s:'),
+ 'call_call' => array( 'it' => 'Chiama %s%s:',
+ 'en' => 'The declarer is %s%s:')
+
+
+ );
+
+// MLANG
+$table_wellarr = Array( 'it' => Array ( 'Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.'),
+ 'en' => Array ( 'EN Benvenuto al tavolo. Se almeno tre giocatori non sbloccano l\'uscita cliccando il lucchetto, chi esce non può risedersi a un qualunque tavolo per '.floor(BAN_TIME/60).' minuti.') );
+
+function multoval($mult)
+{
+ GLOBAL $G_lang;
+
+ if ($mult == 2)
+ return ($G_lang == 'en' ? 'double' : 'doppio');
+ if ($mult == 3)
+ return ($G_lang == 'en' ? 'triple' : 'triplo');
+ else if ($mult == 4)
+ return ($G_lang == 'en' ? 'quadruple' : 'quadruplo');
+ else
+ return (sprintf(($G_lang == 'en' ? "%d-ple" : "%d-plo"), $mult));
+}
+
+
+class Card {
+ var $value; /* 0 - 39 card value */
+ var $stat; /* 'bunch', 'hand', 'table', 'take' */
+ var $owner; /* (table position 0-4) */
+ // var $pos; /* Pos in hand. */
+ var $x; /* When played the X position on the table of the owner. */
+ var $y; /* When played the Y position on the table of the owner. */
+
+ function Card($value, $stat, $owner)
+ {
+ $this->value = $value;
+ $this->stat = $stat; // Card stat
+ $this->owner = $owner;
+ }
+
+ function assign($stat,$owner)
+ {
+ $this->stat = $stat; // Card stat
+ $this->owner = $owner;
+ }
+
+ function setpos($pos)
+ {
+ $this->pos = $pos;
+ }
+
+ function play($x,$y)
+ {
+ $this->stat = 'table'; // Card stat
+ $this->x = $x;
+ $this->y = $y;
+ }
+
+ function take($newown)
+ {
+ $this->stat = 'take'; // Card stat
+ $this->owner = $newown;
+ }
+} // end class Card
+
+class Bin5_table extends Table {
+ var $card; // il mazzo di carte
+ var $mazzo; // chi e' di mazzo
+ var $gstart;
+ var $turn;
+
+ var $asta_pla;
+ var $asta_pla_n;
+ var $asta_card;
+ var $asta_pnt;