Files
RobustToolbox/Robust.Server/Interfaces/GameObjects/IMapInit.cs
T
bc87f2ea9c Pause refactor (#1314)
* Refactor pausing

* Sprite as well woops

* Bring PauseManagerExt back with [Obsolete] so that content compiles.

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-10-12 18:16:20 +02:00

28 lines
727 B
C#

using System.Linq;
using Robust.Server.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
namespace Robust.Server.Interfaces.GameObjects
{
/// <summary>
/// Defines a component that has "map initialization" behavior.
/// Basically irreversible behavior that moves the map from "map editor" to playable,
/// like spawning preset objects.
/// </summary>
public interface IMapInit
{
void MapInit();
}
public static class MapInitExt
{
public static void RunMapInit(this IEntity entity)
{
foreach (var init in entity.GetAllComponents<IMapInit>())
{
init.MapInit();
}
}
}
}