GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0254c9...47ea54 )
by
unknown
01:26
created

BasePlayer.ladder_rating()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
from abc import ABCMeta
2
3
from trueskill import Rating
4
5
from faf.factions import Faction
6
7
8
class BasePlayer:
9
    """
10
    Abstract base class for players
11
    """
12
    __metaclass__ = ABCMeta
13
14
    def __init__(self, id, login):
15
        self._faction = 0
16
        self._global_rating = (1500, 500)
17
        self._ladder_rating = (1500, 500)
18
19
        self.id = id
20
        self.login = login
21
22
    @property
23
    def global_rating(self):
24
        return self._global_rating
25
26
    @global_rating.setter
27
    def global_rating(self, value: Rating):
28
        if isinstance(value, Rating):
29
            self._global_rating = (value.mu, value.sigma)
30
        else:
31
            self._global_rating = value
32
33
    @property
34
    def ladder_rating(self):
35
        return self._ladder_rating
36
37
    @ladder_rating.setter
38
    def ladder_rating(self, value: Rating):
39
        if isinstance(value, Rating):
40
            self._ladder_rating = (value.mu, value.sigma)
41
        else:
42
            self._ladder_rating = value
43
44
    @property
45
    def faction(self):
46
        return self._faction
47
48
    @faction.setter
49
    def faction(self, value):
50
        if isinstance(value, str):
51
            self._faction = Faction.from_string(value)
52
        else:
53
            self._faction = value
54