forked from halo-battle/game
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
|
<?php
|
||
|
/***************************************************************************
|
||
|
* class.user.php
|
||
|
* ----------------
|
||
|
* begin : Dimanche 7 septembre 2008
|
||
|
* update : Dimanche 7 septembre 2008
|
||
|
* email : nemunaire@gmail.com
|
||
|
*
|
||
|
*
|
||
|
***************************************************************************/
|
||
|
class User{
|
||
|
var $id_user,
|
||
|
$technologies = array(),
|
||
|
$credits;
|
||
|
|
||
|
/**
|
||
|
* Constructeur
|
||
|
* @param int $id id de la planète à importer
|
||
|
*
|
||
|
* @return void
|
||
|
* @access public
|
||
|
*/
|
||
|
function User($user){
|
||
|
global $technoloVAR;
|
||
|
$this->id_user = $user["id"];
|
||
|
$this->credits = $user["credits"];
|
||
|
|
||
|
foreach($technoloVAR as $tech){
|
||
|
$this->technologies[] = $user[$tech];
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function calculerTechnologies(){
|
||
|
global $technoloCALC;
|
||
|
$pointstech = 0;
|
||
|
$planete = $this;
|
||
|
|
||
|
foreach($this->batiments as $k => $n){
|
||
|
eval($technoloCALC[$k][0]);
|
||
|
eval($technoloCALC[$k][1]);
|
||
|
eval($technoloCALC[$k][2]);
|
||
|
$pointstech += $a + $b + $c;
|
||
|
}
|
||
|
|
||
|
return $pointstech;
|
||
|
}
|
||
|
}
|
||
|
?>
|