Fix /me/games
This commit is contained in:
parent
4fc05f2eb8
commit
37a14f567b
4 changed files with 26 additions and 3 deletions
|
@ -77,20 +77,23 @@ class ScoreControllerProvider implements ControllerProviderInterface
|
||||||
|
|
||||||
// set game appends hit to game
|
// set game appends hit to game
|
||||||
$hit->setGame($game);
|
$hit->setGame($game);
|
||||||
|
$hit->setTarget($target);
|
||||||
|
|
||||||
|
$hit->setScore($data_hit['score']);
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
$hit->setGlasses($data_hit['glasses']);
|
$hit->setGlasses($data_hit['glasses']);
|
||||||
foreach(Models\Hit::$ATTRIBUTES as $attribute) {
|
foreach(Models\Hit::$ATTRIBUTES as $attribute) {
|
||||||
$hit->setAttribute($data_hit[$attribute]);
|
$hit->setAttribute($attribute, $data_hit[$attribute]);
|
||||||
}
|
}
|
||||||
// emotions
|
// emotions
|
||||||
foreach(Models\Hit::$EMOTIONS as $emotion) {
|
foreach(Models\Hit::$EMOTIONS as $emotion) {
|
||||||
$hit->setEmotion($data_hit['emotions'][$emotion]);
|
$hit->setEmotion($emotion, $data_hit['emotions'][$emotion]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//expressions
|
//expressions
|
||||||
foreach(Models\Hit::$EXPRESSIONS as $expression) {
|
foreach(Models\Hit::$EXPRESSIONS as $expression) {
|
||||||
$hit->setExpression($data_hit['expressions'][$expression]);
|
$hit->setExpression($expression, $data_hit['expressions'][$expression]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//points
|
//points
|
||||||
|
|
|
@ -1657,6 +1657,12 @@ class Hit
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setTarget(Target $target) {
|
||||||
|
$this->target = $target;
|
||||||
|
$target->addHit($this);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the value of score.
|
* Sets the value of score.
|
||||||
*
|
*
|
||||||
|
|
|
@ -81,4 +81,14 @@ class Level
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of id.
|
||||||
|
*
|
||||||
|
* @return integer
|
||||||
|
*/
|
||||||
|
public function getId()
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,4 +71,8 @@ class Target
|
||||||
$this->time = $time;
|
$this->time = $time;
|
||||||
$this->position = $position;
|
$this->position = $position;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function addHit(Hit $hit){
|
||||||
|
$this->hits->add($hit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue