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 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 readonly EntityUid? OldMapId;
public TransformComponent Transform { get; }
///
/// Creates a new instance of .
///
public EntParentChangedMessage(EntityUid entity, EntityUid? oldParent, EntityUid? oldMapId, TransformComponent xform)
{
Entity = entity;
OldParent = oldParent;
Transform = xform;
OldMapId = oldMapId;
}
}
}