source: geniuswebcore/geniusweb/events/TournamentStarted.py@ 80

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

Fix for IssueValue hashcode.

File size: 798 bytes
Line 
1from geniusweb.events.ProtocolEvent import ProtocolEvent
2
3class TournamentStarted (ProtocolEvent):
4
5 def __init__(self, numberOfSessions:int=0,time:int=0):
6 '''
7 @param numberOfSessions the total number of sessions in the tournament
8 @param time the current timestamp
9 '''
10 super().__init__(time)
11 self._numberOfSessions = numberOfSessions
12
13 def getNumberOfSessions(self) -> int:
14 return self._numberOfSessions
15
16 def __repr__(self) -> str:
17 return "TournamentStarted[" + str(self.getTime()) + "," + str(self._numberOfSessions) + "]"
18
19 def __hash__(self):
20 return hash((self._time, self._numberOfSessions))
21
22 def __eq__(self, other) -> bool:
23 return super().__eq__(other) and self.getTime()==other.getTime() \
24 and self._numberOfSessions==other._numberOfSessions
25
Note: See TracBrowser for help on using the repository browser.