diff options
author | Guillaume Seguin <guillaume@segu.in> | 2009-11-23 23:29:21 +0100 |
---|---|---|
committer | Guillaume Seguin <guillaume@segu.in> | 2009-11-23 23:29:21 +0100 |
commit | 4e5b3bad7d56160712cf4b9ad96611db5e812b6e (patch) | |
tree | 057e697d93163b7cb3f50dcc5de03eeee83c6cf5 | |
parent | 63117a7d51b10ce266abd769a3df8dab909c4417 (diff) | |
download | netnavalbattle-4e5b3bad7d56160712cf4b9ad96611db5e812b6e.tar.gz netnavalbattle-4e5b3bad7d56160712cf4b9ad96611db5e812b6e.tar.bz2 |
Synchronize sink_notification format
-rw-r--r-- | netnavalbattle/event.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/netnavalbattle/event.py b/netnavalbattle/event.py index 6daaa56..5ad96dd 100644 --- a/netnavalbattle/event.py +++ b/netnavalbattle/event.py @@ -548,27 +548,31 @@ class SinkNotificationEvent (Event): y = None rotated = None - def __init__ (self, source, target, ship_type, x, y, rotated): + def __init__ (self, source, target, x, y, ship_type, rotated): self.source = source self.target = target - self.ship_type = ship_type self.x = x self.y = y + self.ship_type = ship_type + if type (rotated) == type (True): + rotated = "horizontal" if rotated else "vertical" self.rotated = rotated def process (self, context): + rotated = self.rotated == "horizontal" context.sink_notification (self.target, - self.ship_type, self.x, self.y, - self.rotated) + self.ship_type, + rotated) def get_args (self): return [self.source, self.target, - self.ship_type, self.x, self.y, self.rotated] + self.x, self.y, self.ship_type, self.rotated] @staticmethod def describe_args (): - return ["base64-string", "base64-string", "string", "int", "int", "bool"] + return ["base64-string", "base64-string", + "int", "int", "string", "string"] class LostNotificationEvent (Event): |