mirror of
https://github.com/furyfire/trueskill.git
synced 2025-04-18 20:04:28 +00:00
Simplifying
This commit is contained in:
@ -11,6 +11,12 @@ use Exception;
|
||||
*/
|
||||
abstract class SkillCalculator
|
||||
{
|
||||
public const NONE = 0x00;
|
||||
|
||||
public const PARTIAL_PLAY = 0x01;
|
||||
|
||||
public const PARTIAL_UPDATE = 0x02;
|
||||
|
||||
protected function __construct(
|
||||
private readonly int $supportedOptions,
|
||||
private readonly TeamsRange $totalTeamsAllowed,
|
||||
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DNW\Skills;
|
||||
|
||||
class SkillCalculatorSupportedOptions
|
||||
{
|
||||
public const NONE = 0x00;
|
||||
|
||||
public const PARTIAL_PLAY = 0x01;
|
||||
|
||||
public const PARTIAL_UPDATE = 0x02;
|
||||
}
|
@ -14,7 +14,6 @@ use DNW\Skills\PartialPlay;
|
||||
use DNW\Skills\PlayersRange;
|
||||
use DNW\Skills\RankSorter;
|
||||
use DNW\Skills\SkillCalculator;
|
||||
use DNW\Skills\SkillCalculatorSupportedOptions;
|
||||
use DNW\Skills\Team;
|
||||
use DNW\Skills\TeamsRange;
|
||||
use DNW\Skills\RatingContainer;
|
||||
@ -27,7 +26,7 @@ class FactorGraphTrueSkillCalculator extends SkillCalculator
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(SkillCalculatorSupportedOptions::PARTIAL_PLAY | SkillCalculatorSupportedOptions::PARTIAL_UPDATE, TeamsRange::atLeast(2), PlayersRange::atLeast(1));
|
||||
parent::__construct(SkillCalculator::PARTIAL_PLAY | SkillCalculator::PARTIAL_UPDATE, TeamsRange::atLeast(2), PlayersRange::atLeast(1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,9 +13,7 @@ use DNW\Skills\RankSorter;
|
||||
use DNW\Skills\Rating;
|
||||
use DNW\Skills\RatingContainer;
|
||||
use DNW\Skills\SkillCalculator;
|
||||
use DNW\Skills\SkillCalculatorSupportedOptions;
|
||||
use DNW\Skills\TeamsRange;
|
||||
use DNW\Skills\Team;
|
||||
|
||||
/**
|
||||
* Calculates the new ratings for only two players.
|
||||
@ -27,7 +25,7 @@ class TwoPlayerTrueSkillCalculator extends SkillCalculator
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(SkillCalculatorSupportedOptions::NONE, TeamsRange::exactly(2), PlayersRange::exactly(1));
|
||||
parent::__construct(SkillCalculator::NONE, TeamsRange::exactly(2), PlayersRange::exactly(1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,6 @@ use DNW\Skills\RankSorter;
|
||||
use DNW\Skills\Rating;
|
||||
use DNW\Skills\RatingContainer;
|
||||
use DNW\Skills\SkillCalculator;
|
||||
use DNW\Skills\SkillCalculatorSupportedOptions;
|
||||
use DNW\Skills\Team;
|
||||
use DNW\Skills\TeamsRange;
|
||||
|
||||
@ -26,7 +25,7 @@ class TwoTeamTrueSkillCalculator extends SkillCalculator
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(SkillCalculatorSupportedOptions::NONE, TeamsRange::exactly(2), PlayersRange::atLeast(1));
|
||||
parent::__construct(SkillCalculator::NONE, TeamsRange::exactly(2), PlayersRange::atLeast(1));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user