from . import packet as p

class Tracker:
    def __init__(self):
        self.objects = {}

    def update_object(self, record):
        try:
            oid = record['object']
        except KeyError:
            return
        else:
            self.objects.setdefault(oid, {}).update(record)

    def remove_object(self, oid):
        try:
            del self.objects[oid]
        except KeyError:
            pass

    def rx(self, packet):
        if isinstance(packet, p.ObjectUpdatePacket):
            for record in packet.records:
                self.update_object(record)
        elif isinstance(packet, p.DestroyObjectPacket):
            self.remove_object(packet.object)


@@ -86,16 +86,206 @@
 s = %7B%7D%0A%0A
+    @property%0A    def player_ship(self):%0A        for _obj in self.objects.values():%0A            if _obj%5B'type'%5D == p.ObjectType.player_vessel:%0A                return _obj%0A        return %7B%7D%0A%0A
     def 

Add a convenience method to get the player ship