using Robust.Shared.Map; namespace Robust.Shared.GameObjects { /// /// Raised when an entity parent is changed. /// [ByRefEvent] public readonly struct EntParentChangedMessage { /// /// Entity that was adopted. The transform component has a property with the new parent. /// public EntityUid Entity { get; } /// /// Old parent that abandoned the Entity. /// public EntityUid? OldParent { get; } /// /// The map Id that the entity was on before its parent changed. /// /// /// If the old parent was detached to null without manually updating the map ID of its children, then this /// is required as we cannot simply use the old parent's map ID. Also avoids having to fetch the old /// parent's transform component. /// public MapId OldMapId { get; } /// /// Creates a new instance of . /// /// /// public EntParentChangedMessage(EntityUid entity, EntityUid? oldParent, MapId oldMapId) { Entity = entity; OldParent = oldParent; OldMapId = oldMapId; } } }