SXObject is the base class for all important samurai-x2 classes. It is an event dispatcher (samurai-x2 uses the event system of ooxcb which is the event system of pyglet), but it also has a convenient method for plugins.
Attaches the object data to self, identified by the key key. You can access the attached data using SXObject.data.
That’s a convenient method for plugins. They can easily attach any value to any samurai-x2 object.
However, plugins shouldn’t use SXObject.attach_data() directly. Use Plugin.attach_data_to().