Skip to content

Commit af974eb

Browse files
committed
Flesh out the ping class.
1 parent dcb3e8e commit af974eb

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
CHANGELOG
22
============
33

4+
5+
0.6.5 - December ?? 2013
6+
---------------------------
7+
8+
* PingEvents now have new attributes:
9+
* event.to_all - true if ping seen by all
10+
* event.to_allies - true if ping seen by allies
11+
* event.to_observers - true if ping seen by observers
12+
* event.location - tuple of (event.x, event.y)
13+
14+
415
0.6.4 - September 22nd 2013
516
---------------------------
617

sc2reader/events/message.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,24 @@ class PingEvent(MessageEvent):
5151

5252
def __init__(self, frame, pid, target, x, y):
5353
super(PingEvent, self).__init__(frame, pid)
54+
55+
#: The numerical target type. 0 = to all; 2 = to allies; 4 = to observers.
5456
self.target = target
55-
self.x, self.y = x, y
57+
58+
#: Flag marked true of message was to all.
59+
self.to_all = (self.target == 0)
60+
61+
#: Flag marked true of message was to allies.
62+
self.to_allies = (self.target == 2)
63+
64+
#: Flag marked true of message was to observers.
65+
self.to_observers = (self.target == 4)
66+
67+
#: The x coordinate of the target location
68+
self.x = x
69+
70+
#: The y coordinate of the target location
71+
self.y = y
72+
73+
#: The (x,y) coordinate of the target location
74+
self.location = (self.x, self.y)

0 commit comments

Comments
 (0)