immersive-home/lib/events/event.gd

10 lines
256 B
GDScript3
Raw Normal View History

2023-11-22 02:44:07 +02:00
extends Resource
class_name Event
func merge(event: Event):
assert(self.is_class(event.get_class()), "Can only merge events of the same type.")
for prop in event.get_property_list():
if prop.name in self:
self.set(prop.name, event.get(prop.name))