Last change
on this file since 81 was 81, checked in by Bart Vastenhouw, 3 years ago |
Added python timedependent parties (conceder, hardliner, etc)
|
File size:
735 bytes
|
Line | |
---|
1 | import time
|
---|
2 |
|
---|
3 | from geniusweb.events.CurrentState import CurrentState
|
---|
4 | from geniusweb.protocol.NegoState import NegoState
|
---|
5 |
|
---|
6 |
|
---|
7 | class CurrentNegoState (CurrentState):
|
---|
8 | '''
|
---|
9 | Implementation of CurrentState event. This contains NegoState and therefore
|
---|
10 | can not be defined in the events module.
|
---|
11 | '''
|
---|
12 |
|
---|
13 | def __init__(self, state:NegoState, now:int=round(1000*time.time())) :
|
---|
14 | super().__init__(now)
|
---|
15 | self._state = state;
|
---|
16 |
|
---|
17 |
|
---|
18 | def getState(self) -> NegoState:
|
---|
19 | return self._state
|
---|
20 |
|
---|
21 |
|
---|
22 | def __repr__(self):
|
---|
23 | return "CurrentNegoState[" + str(self.getTime())\
|
---|
24 | + "," + str(self._state) + "]"
|
---|
25 |
|
---|
26 | def __hash__(self):
|
---|
27 | return hash((self._state, self._time))
|
---|
28 |
|
---|
29 | def __eq__(self, other):
|
---|
30 | return super().__eq__(other) and \
|
---|
31 | self._state==other._state
|
---|
Note:
See
TracBrowser
for help on using the repository browser.