samuraix.base

class samuraix.base.SXObject

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.

data
A dictionary connecting keys to data.
attach_data(key, data)

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().

samurai-x

Previous topic

samuraix.appl

Next topic

samuraix.client

This Page