Add interaction tests (#15251)

This commit is contained in:
Leon Friedrich
2023-04-15 07:41:25 +12:00
committed by GitHub
parent ffe946729f
commit 489660a6bb
36 changed files with 2354 additions and 32 deletions

View File

@@ -352,6 +352,10 @@ namespace Content.Server.Construction
}
}
var entChangeEv = new ConstructionChangeEntityEvent(newUid, uid);
RaiseLocalEvent(uid, entChangeEv);
RaiseLocalEvent(newUid, entChangeEv, broadcast: true);
QueueDel(uid);
return newUid;
@@ -384,4 +388,20 @@ namespace Content.Server.Construction
return ChangeNode(uid, userUid, nodeId, performActions, construction);
}
}
/// <summary>
/// This event gets raised when an entity changes prototype / uid during construction. The event is raised
/// directed both at the old and new entity.
/// </summary>
public sealed class ConstructionChangeEntityEvent : EntityEventArgs
{
public readonly EntityUid New;
public readonly EntityUid Old;
public ConstructionChangeEntityEvent(EntityUid newUid, EntityUid oldUid)
{
New = newUid;
Old = oldUid;
}
}
}