Object Types

There are three basic types of object in Vehicle Spy X, each a superset of the last. They are Linkables, Objects, and ResolverObjects.

Linkables

The first and most basic is the vspyx.Core.Linkable. It is a type of object which has parents and children, which are more Linkables. It is designed to be light enough for decodings of network traffic, which is why it forms the base of vspyx.Runtime.Point.

Objects

The second is the vspyx.Core.Object. It is used for static (i.e. non-traffic) objects which are transient or valid for a single run of the simulation. It is a subclass of Linkable, so it can also be linked with parents and children. The most important distinction to make is that it serializes its state to Protobuf, and changes to this state can be hooked with callbacks. We use this to update the UI in a less procedural way.

Resolver Objects

The third and most common is the vspyx.Core.ResolverObject. It is used for static objects which potentially persist longer than a single run of the simulation. It is a subclass of Object, so it serializes its state to Protobuf and can be linked with parents and children. To this, it adds several key features.

It serialzes a configuration to Protobuf, and the object can be recreated from this configuration. This is important for saving and loading of setups.

It has an ID, which is a short string name for the object but not necessarily globally unique, and a UUID, which is a globally unique string which identifies the object.

Lastly, it can be registered into Vehicle Spy X’s object resolver, allowing us to find and reference the object in other places.