Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 26 lines (23 sloc) 0.775 kb
cb46631f »
2010-03-18 Initial version of Moserware.Skills TrueSkill calculator to go along …
1 namespace Moserware.Skills
2 {
3 internal static class PartialPlay
4 {
5 public static double GetPartialPlayPercentage(object player)
6 {
7 // If the player doesn't support the interface, assume 1.0 == 100%
8 var partialPlay = player as ISupportPartialPlay;
9 if (partialPlay == null)
10 {
11 return 1.0;
12 }
13
14 double partialPlayPercentage = partialPlay.PartialPlayPercentage;
15
16 // HACK to get around bug near 0
17 const double smallestPercentage = 0.0001;
18 if (partialPlayPercentage < smallestPercentage)
19 {
20 partialPlayPercentage = smallestPercentage;
21 }
22
23 return partialPlayPercentage;
24 }
25 }
26 }
Something went wrong with that request. Please try again.