Correct anchor events (#6140)

This commit is contained in:
Leon Friedrich
2022-01-13 06:49:28 +13:00
committed by GitHub
parent 2aefca868d
commit 21480c716a
6 changed files with 33 additions and 52 deletions

View File

@@ -71,9 +71,14 @@ namespace Content.Server.Construction.Components
public BeforeAnchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
}
public class AnchoredEvent : BaseAnchoredEvent
/// <summary>
/// Raised when an entity with an anchorable component is anchored. Note that you may instead want the more
/// general <see cref="AnchorStateChangedEvent"/>. This event has the benefit of having user & tool information,
/// as a result of interactions mediated by the <see cref="AnchorableSystem"/>.
/// </summary>
public class UserAnchoredEvent : BaseAnchoredEvent
{
public AnchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
public UserAnchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
}
/// <summary>
@@ -84,8 +89,14 @@ namespace Content.Server.Construction.Components
public BeforeUnanchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
}
public class UnanchoredEvent : BaseAnchoredEvent
/// <summary>
/// Raised when an entity with an anchorable component is unanchored. Note that you will probably also need to
/// subscribe to the more general <see cref="AnchorStateChangedEvent"/>, which gets raised BEFORE this one. This
/// event has the benefit of having user & tool information, whereas the more general event may be due to
/// explosions or grid-destruction or other interactions not mediated by the <see cref="AnchorableSystem"/>.
/// </summary>
public class UserUnanchoredEvent : BaseAnchoredEvent
{
public UnanchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
public UserUnanchoredEvent(EntityUid user, EntityUid tool) : base(user, tool) { }
}
}