Files
RobustToolbox/Robust.Shared/GameObjects/Components/DebugExceptionComponents.cs
T
AcruidandGitHub 713f702064 Engine Entity Anchoring (#1829)
* Added unit tests for the new anchor system design.

* Amend ME!

* SnapGridComponent now anchors the entity when added or removed.
TransformComponent.Anchored properly replicates it's state to clients.

* Converted all SnapGridPositionChangedEvent subscriptions to AnchorStateChangedEvent.
Removed SnapGridPositionChangedEvent.
Obsoleted SnapGridComponent.

* Allows setting Transform.Anchored in prototypes.

* Changing tile to empty under anchored ents unanchors them.

* More unit testing.

* Migrated transform gamestate tests to RobustServerSimulation.

* Fixed nasty off-by-one error when sending a full server state.

* Adds lifetime stages to Component.

* More test fixing.

* Review changes.
2021-06-19 17:26:18 -07:00

44 lines
1.3 KiB
C#

using System;
using Robust.Shared.Serialization;
namespace Robust.Shared.GameObjects
{
#if DEBUG
// If you wanna use these, add it to some random prototype.
// I recommend the #1 mug:
// 1. it doesn't spawn on the map (currently).
// 2. it's at the top of the entity list (currently).
// 3. it crashed the game before, it's iconic!
/// <summary>
/// Throws an exception in <see cref="OnAdd" />.
/// </summary>
public sealed class DebugExceptionOnAddComponent : Component
{
public override string Name => "DebugExceptionOnAdd";
protected override void OnAdd() => throw new NotSupportedException();
}
/// <summary>
/// Throws an exception in <see cref="Initialize" />.
/// </summary>
public sealed class DebugExceptionInitializeComponent : Component
{
public override string Name => "DebugExceptionInitialize";
protected override void Initialize() => throw new NotSupportedException();
}
/// <summary>
/// Throws an exception in <see cref="Startup" />.
/// </summary>
public sealed class DebugExceptionStartupComponent : Component
{
public override string Name => "DebugExceptionStartup";
protected override void Startup() => throw new NotSupportedException();
}
#endif
}