pytower.object
- class pytower.object.TowerObject(item=None, properties=None, nocopy=False)[source]
Represents an object appearing in the Suitebro file. This includes all the sections of the object.
- __init__(item=None, properties=None, nocopy=False)[source]
Initializes TowerObject instance taking in uesave json data
To ensure uniqueness, this assigns a new GUID to this object
- add_connection(con)[source]
Adds a connection to this object
- Parameters:
con (
ItemConnectionObject) – The connection to add to this object
- connect_to(listener_event_name, other, event_name, delay=0.0, data=None)[source]
Connect this object to another object
- Parameters:
listener_event_name (
str) – The name of the listener event to connect to (for example, “OnFired”)other (
TowerObject) – The other object to connect toevent_name (
str) – The name of the event on this object to connect fromdelay (
float) – The delay in secondsdata (
Optional[ItemConnectionData]) – The optional data to use for this event
- copy()[source]
Creates a new TowerObject with the same item and properties as this one.
- Return type:
- Returns:
Copy of this TowerObject instance
- get_custom_name()[source]
Deprecated since version 0.3.0: Use TowerObject.custom_name instead
- Return type:
- get_property(path)[source]
Gets property value
- set_connections(cons)[source]
Set all the connections attached to this object. Useful when resetting/overriding connections
- Parameters:
cons (
list[ItemConnectionObject]) – List of connections to attach onto this object
- set_group_id(group_id)[source]
Deprecated since version 0.3.0: Assign to TowerObject.group_id instead
- Parameters:
group_id (int)