Total Complexity | 8 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 93.33% |
Changes | 0 |
1 | #!/usr/local/bin/python |
||
2 | # coding: utf-8 |
||
3 | 1 | import abc |
|
4 | |||
5 | |||
6 | 1 | class Server(abc.ABC): |
|
7 | """Server Model Template, containing properties for same attributes of MasterServer and GameServer obejcts""" |
||
8 | 1 | _ip: str = '' |
|
9 | 1 | _port: int = 8300 |
|
10 | 1 | _response: bool = False |
|
11 | 1 | _request_token: bytes = b'' |
|
12 | |||
13 | 1 | @property |
|
14 | 1 | def ip(self) -> str: |
|
15 | 1 | return self._ip |
|
16 | |||
17 | 1 | @ip.setter |
|
18 | 1 | def ip(self, ip: str) -> None: |
|
19 | self._ip = ip |
||
20 | |||
21 | 1 | @property |
|
22 | 1 | def port(self) -> int: |
|
23 | 1 | return self._port |
|
24 | |||
25 | 1 | @port.setter |
|
26 | 1 | def port(self, port: int) -> None: |
|
27 | self._port = port |
||
28 | |||
29 | 1 | @property |
|
30 | 1 | def response(self) -> bool: |
|
31 | 1 | return self._response |
|
32 | |||
33 | 1 | @response.setter |
|
34 | 1 | def response(self, response: bool) -> None: |
|
35 | 1 | self._response = response |
|
36 | |||
37 | 1 | @property |
|
38 | 1 | def request_token(self) -> bytes: |
|
39 | 1 | return self._request_token |
|
40 | |||
41 | 1 | @request_token.setter |
|
42 | 1 | def request_token(self, token: bytes) -> None: |
|
43 | self._request_token = token |
||
44 |