Last change
on this file since 94 was 90, checked in by Bart Vastenhouw, 3 years ago |
Refactor to help reusing partiesserver.
|
File size:
698 bytes
|
Line | |
---|
1 | from abc import ABC
|
---|
2 |
|
---|
3 | from pyson.JsonSubTypes import JsonSubTypes
|
---|
4 | from pyson.JsonTypeInfo import Id, As
|
---|
5 | from pyson.JsonTypeInfo import JsonTypeInfo
|
---|
6 |
|
---|
7 |
|
---|
8 | @JsonSubTypes(["geniusweb.inform.Settings.Settings",\
|
---|
9 | "geniusweb.inform.YourTurn.YourTurn",\
|
---|
10 | "geniusweb.inform.ActionDone.ActionDone",\
|
---|
11 | "geniusweb.inform.Finished.Finished",\
|
---|
12 | "geniusweb.inform.OptIn.OptIn",\
|
---|
13 | "geniusweb.inform.Voting.Voting"\
|
---|
14 | ])
|
---|
15 | @JsonTypeInfo(use=Id.NAME, include=As.WRAPPER_OBJECT)
|
---|
16 | class Inform(ABC):
|
---|
17 |
|
---|
18 | '''
|
---|
19 | base class of all information sent to a Party
|
---|
20 | HACK for now this just extends dict, instead
|
---|
21 | of properly defining all subclasses.
|
---|
22 | '''
|
---|
23 |
|
---|
24 | def __eq__(self, other):
|
---|
25 | return isinstance(other, self.__class__)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.