Last change
on this file since 80 was 73, checked in by Bart Vastenhouw, 3 years ago |
Fix for IssueValue hashcode.
|
File size:
866 bytes
|
Line | |
---|
1 | from typing import Dict, Any
|
---|
2 | from geniusweb.actions.AbstractAction import AbstractAction
|
---|
3 | from geniusweb.actions.PartyId import PartyId
|
---|
4 | from geniusweb.issuevalue.Bid import Bid
|
---|
5 |
|
---|
6 |
|
---|
7 | class ActionWithBid ( AbstractAction ):
|
---|
8 | '''
|
---|
9 | An {@link Action} containing a bid. Note that the presense of a bid does not
|
---|
10 | necessarily mean that an offer was placed for this bid.
|
---|
11 |
|
---|
12 | '''
|
---|
13 |
|
---|
14 | def __init__(self, actor:PartyId, bid:Bid):
|
---|
15 | '''
|
---|
16 | @param param the actor partyid:
|
---|
17 | @param bid the bid. FIXME use Bid object and strong typing
|
---|
18 | '''
|
---|
19 | super().__init__(actor)
|
---|
20 | self._bid = bid
|
---|
21 |
|
---|
22 | def getBid(self) -> Bid:
|
---|
23 | '''
|
---|
24 | @return the {@link Bid} that this action is about.
|
---|
25 | '''
|
---|
26 | return self._bid;
|
---|
27 |
|
---|
28 | def __eq__(self, other):
|
---|
29 | return isinstance(other, self.__class__) and \
|
---|
30 | super().__eq__(other) and self._bid==other._bid
|
---|
31 |
|
---|
32 | def __hash__(self):
|
---|
33 | return hash((self._actor, self._bid))
|
---|
34 | |
---|
Note:
See
TracBrowser
for help on using the repository browser.