player detailed started statistics

This commit is contained in:
kremsy 2014-01-03 17:36:10 +01:00
parent 3e7083d377
commit f8ba365af5
3 changed files with 29 additions and 2 deletions

View File

@ -42,7 +42,6 @@ class Player {
if(!$rpcInfos) { if(!$rpcInfos) {
return; return;
} }
var_dump($rpcInfos);
$this->pid = $rpcInfos['PlayerId']; $this->pid = $rpcInfos['PlayerId'];
$this->login = $rpcInfos['Login']; $this->login = $rpcInfos['Login'];

View File

@ -195,14 +195,31 @@ class PlayerDetailed {
$quad = new Quad(); $quad = new Quad();
$frame->add($quad); $frame->add($quad);
$quad->setImage('file://' . $player->avatar); $quad->setImage('file://' . $target->avatar);
$quad->setPosition($this->width / 2 - 10, $this->height / 2 - 10); $quad->setPosition($this->width / 2 - 10, $this->height / 2 - 10);
$quad->setAlign(Control::RIGHT, Control::TOP); $quad->setAlign(Control::RIGHT, Control::TOP);
$quad->setSize(20, 20); $quad->setSize(20, 20);
//Statistics
$frame->add($this->statisticsFrame($target));
// render and display xml // render and display xml
$this->maniaControl->manialinkManager->displayWidget($maniaLink, $player); $this->maniaControl->manialinkManager->displayWidget($maniaLink, $player);
} }
public function statisticsFrame($player){
$frame = new Frame();
/*$mainLabel = new Label_Text();
$frame->add($mainLabel);
$mainLabel->setPosition(-$this->width / 2 + 50, $this->height / 2 - 10);
$mainLabel->setTextSize(1.2);
$mainLabel->setHAlign(Control::LEFT);
$mainLabel->setText("Statistics");*/
var_dump($this->maniaControl->statisticManager->getAllPlayerStats($player));
return $frame;
}
} }

View File

@ -116,6 +116,16 @@ class StatisticManager {
} }
} }
public function getAllPlayerStats(Player $player){
$playerStats = array(); //TODO improve performant
foreach($this->stats as $stat){
// $value = $this->getStatisticData($stat['name'], $player->index);
// var_dump($value);
//$playerStats[$stat] = $value;
}
return $playerStats;
}
/** /**
* Inserts a Stat into the database * Inserts a Stat into the database
* *
@ -221,6 +231,7 @@ class StatisticManager {
return true; return true;
} }
/** /**
* Initialize necessary database tables * Initialize necessary database tables
* *