Skip to content

Commit

Permalink
Add back HighScoreSkillComparison->getSkill() and HighScoreActivityCo…
Browse files Browse the repository at this point in the history
…mparison->getActivity()
  • Loading branch information
villermen committed Feb 4, 2018
1 parent 59c9116 commit 525428b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/HighScore/HighScoreActivityComparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

namespace Villermen\RuneScape\HighScore;

use Villermen\RuneScape\Activity;
use Villermen\RuneScape\Exception\RuneScapeException;

class HighScoreActivityComparison extends HighScoreEntryComparison
{
/** @var Activity */
protected $activity;

/** @var int */
protected $scoreDifference;

Expand All @@ -31,9 +35,18 @@ public function __construct($activity1, $activity2)
throw new RuneScapeException("Can't compare two different activities.");
}

$this->activity = $activity1->getActivity();
$this->scoreDifference = $activity1->getScore() - $activity2->getScore();
}

/**
* @return Activity
*/
public function getActivity(): Activity
{
return $this->activity;
}

/**
* @return int
*/
Expand Down
13 changes: 13 additions & 0 deletions src/HighScore/HighScoreSkillComparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
namespace Villermen\RuneScape\HighScore;

use Villermen\RuneScape\Exception\RuneScapeException;
use Villermen\RuneScape\Skill;

class HighScoreSkillComparison extends HighScoreEntryComparison
{
/** @var Skill */
protected $skill;

/** @var int */
protected $levelDifference;

Expand Down Expand Up @@ -37,11 +41,20 @@ public function __construct($skill1, $skill2)
throw new RuneScapeException("Can't compare two different skills.");
}

$this->skill = $skill1->getSkill();
$this->xpDifference = $skill1->getXp() - $skill2->getXp();
$this->levelDifference = $skill1->getLevel() - $skill2->getLevel();
$this->virtualLevelDifference = $skill1->getVirtualLevel() - $skill2->getVirtualLevel();
}

/**
* @return Skill
*/
public function getSkill(): Skill
{
return $this->skill;
}

/**
* @return int
*/
Expand Down

0 comments on commit 525428b

Please sign in to comment.