mirror of
				https://github.com/furyfire/trueskill.git
				synced 2025-11-04 10:12:28 +01:00 
			
		
		
		
	Naming tweak
This commit is contained in:
		
							
								
								
									
										30
									
								
								Skills/PartialPlay.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Skills/PartialPlay.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
<?php
 | 
			
		||||
namespace Moserware\Skills;
 | 
			
		||||
 | 
			
		||||
require_once(dirname(__FILE__) . "/ISupportPartialPlay.php");
 | 
			
		||||
 | 
			
		||||
class PartialPlay
 | 
			
		||||
{
 | 
			
		||||
    public static function getPartialPlayPercentage($player)
 | 
			
		||||
    {
 | 
			
		||||
        // If the player doesn't support the interface, assume 1.0 == 100%
 | 
			
		||||
        $supportsPartialPlay = $player instanceof ISupportPartialPlay;
 | 
			
		||||
        if (!$supportsPartialPlay)
 | 
			
		||||
        {
 | 
			
		||||
            return 1.0;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $partialPlayPercentage = $player->getPartialPlayPercentage();
 | 
			
		||||
 | 
			
		||||
        // HACK to get around bug near 0
 | 
			
		||||
        $smallestPercentage = 0.0001;
 | 
			
		||||
        if ($partialPlayPercentage < $smallestPercentage)
 | 
			
		||||
        {
 | 
			
		||||
            $partialPlayPercentage = $smallestPercentage;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $partialPlayPercentage;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
		Reference in New Issue
	
	Block a user