Last change
on this file since 92 was 90, checked in by Bart Vastenhouw, 3 years ago |
Refactor to help reusing partiesserver.
|
File size:
900 bytes
|
Rev | Line | |
---|
[90] | 1 | from abc import ABC, abstractmethod
|
---|
| 2 |
|
---|
| 3 | from pyson.JsonSubTypes import JsonSubTypes
|
---|
| 4 | from pyson.JsonTypeInfo import Id, As
|
---|
| 5 | from pyson.JsonTypeInfo import JsonTypeInfo
|
---|
| 6 |
|
---|
| 7 | from geniusweb.actions.PartyId import PartyId
|
---|
| 8 |
|
---|
| 9 |
|
---|
| 10 | @JsonSubTypes(["geniusweb.actions.EndNegotiation.EndNegotiation",\
|
---|
| 11 | "geniusweb.actions.Offer.Offer",\
|
---|
| 12 | "geniusweb.actions.Accept.Accept",\
|
---|
| 13 | "geniusweb.actions.LearningDone.LearningDone",\
|
---|
| 14 | "geniusweb.actions.Vote.Vote",\
|
---|
| 15 | "geniusweb.actions.Votes.Votes",\
|
---|
| 16 | ])
|
---|
| 17 | @JsonTypeInfo(use=Id.NAME, include=As.WRAPPER_OBJECT)
|
---|
| 18 | class Action (ABC):
|
---|
| 19 | '''
|
---|
| 20 | An action represents a "promise" made by a participant in the negotiation. It
|
---|
| 21 | can not be retracted and is immutable. But it can be followed by other
|
---|
| 22 | actions that override it or make it outdated.
|
---|
| 23 | HACK for now this just extends dict intead of defining proper subclasses
|
---|
| 24 | '''
|
---|
| 25 | @abstractmethod
|
---|
| 26 | def getActor(self) -> PartyId:
|
---|
| 27 | pass
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | |
---|
Note:
See
TracBrowser
for help on using the repository browser.