-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjects.py
31 lines (24 loc) · 832 Bytes
/
objects.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import uuid
import rendering
class Object:
def __init__(self, graphic, serialized_data=None):
self.id = hex(uuid.getnode())
self.serialized_data = serialized_data
if serialized_data is None:
self.graphic = graphic
else:
pass
self.vx, self.vy = 0.0, 0.0
def serialize(self):
# TODO Export data to transfer to peers
pass
def deserialize(self, input_data):
# TODO take data and decode value
pass
def move(self, x, y):
rendering.Renderable.move(self.graphic, x, y)
def move_additive(self, x, y, x_init=0.0, y_init=0.0):
rendering.Renderable.move_additive(self.graphic, (x_init - x) / 10, (y_init - y) / 10)
def transfer_to_peer(self, peer):
# TODO Transfer object to peer
pass