source: geniuswebcore/geniusweb/protocol/tournament/Team.py@ 94

Last change on this file since 94 was 90, checked in by Bart Vastenhouw, 3 years ago

Refactor to help reusing partiesserver.

File size: 981 bytes
Line 
1from typing import List
2from geniusweb.references.PartyWithParameters import PartyWithParameters
3class Team:
4 '''
5 A team is a group of parties, each with their own parameters. Each will be
6 coupled to a {@link ProfileList} in the generation phase of the protocol
7 '''
8 def __init__(self, parties: List[PartyWithParameters]):
9 '''
10 @param ps a list of {@link PartyWithParameters}. Each party is always
11 associated with the given parameters. The order of them is
12 important as it will be matched with the order in the
13 {@link ProfileList}.
14 '''
15 self._parties = list(parties)
16
17 def getParties(self) -> List[PartyWithParameters] :
18 '''
19 @return list of all team {@link PartyWithParameters}.
20 '''
21 return list(self._parties)
22
23 def __hash__(self):
24 return hash(tuple(self._parties))
25
26
27 def __eq__(self, other):
28 return isinstance(other, self.__class__) and self._parties == other._parties
29
30 def __repr__(self):
31 return repr(self._parties)
32
Note: See TracBrowser for help on using the repository browser.