diff --git a/DecisionSystem/vote.py b/DecisionSystem/vote.py index ff55df4..f5a5e47 100644 --- a/DecisionSystem/vote.py +++ b/DecisionSystem/vote.py @@ -1,7 +1,7 @@ from Messaging.packmessage import PackMessage class Vote(PackMessage): - def __init__(self, voter, vote): + def __init__(self, vote = None): self._vote = vote @property @@ -12,6 +12,13 @@ class Vote(PackMessage): def vote(self, value): self._vote = value + def __eq__(self, other): + if not isinstance(other, Vote): + return False + + if other.vote == self.vote: + return True + def serialise(self): # Still need associated device as well? to know who went the message,