source: geniuswebcore/geniusweb/references/PartyRef.py@ 85

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

Added time-dependent parties for python and simpleRunner-GUI for java

File size: 759 bytes
RevLine 
[84]1from pyson.JsonValue import JsonValue
2from uri.uri import URI
3
4from geniusweb import party
5from geniusweb.references.Reference import Reference
6
7
8class PartyRef (Reference):
9 '''
10 A URI reference to create a new instance of a party on a party factory
11 server. These are used to describe sesion and tournament settings.
12 '''
13
14
15 def __init__(self, party:URI ):
16 if not isinstance(party, URI):
17 raise ValueError("expected URI, but got "+repr(party))
18 self._party = party
19
20 @JsonValue()
21 def getURI(self)-> URI :
22 return self._party;
23
24 def __repr__(self) ->str:
25 return "PartyRef[" + str(self._party) + "]"
26
27
28 def __eq__(self, other):
29 return isinstance(other, self.__class__) and self._party==other._party
30
31 def __hash__(self):
32 return hash(self._party)
Note: See TracBrowser for help on using the repository browser.