Add equals operator overload

This commit is contained in:
DSTO\pivatom
2018-12-18 10:14:04 +10:30
parent eb9f40bdf1
commit fedadc3af8

View File

@@ -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,