Class EventHorizonSystem
The entity system primarily responsible for managing EventHorizonComponents.
Handles their consumption of entities.
Inheritance
System.Object
EventHorizonSystem
Assembly: Content.Server.dll
Syntax
public sealed class EventHorizonSystem : SharedEventHorizonSystem
Methods
|
Improve this Doc
View Source
AttemptConsumeEntity(EntityUid, EntityUid, EventHorizonComponent, BaseContainer)
Makes an event horizon attempt to consume a given entity.
Declaration
public bool AttemptConsumeEntity(EntityUid hungry, EntityUid morsel, EventHorizonComponent eventHorizon, BaseContainer outerContainer = null)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
EntityUid |
morsel |
|
EventHorizonComponent |
eventHorizon |
|
Robust.Shared.Containers.BaseContainer |
outerContainer |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
AttemptConsumeTile(EntityUid, TileRef, EventHorizonComponent)
Makes an event horizon attempt to consume a specific tile on a grid.
Declaration
public void AttemptConsumeTile(EntityUid hungry, TileRef tile, EventHorizonComponent eventHorizon)
Parameters
|
Improve this Doc
View Source
AttemptConsumeTiles(EntityUid, IEnumerable<TileRef>, EntityUid, MapGridComponent, EventHorizonComponent)
Makes an event horizon attempt to consume a set of tiles on a grid.
Declaration
public int AttemptConsumeTiles(EntityUid hungry, IEnumerable<TileRef> tiles, EntityUid gridId, MapGridComponent grid, EventHorizonComponent eventHorizon)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
IEnumerable<Robust.Shared.Map.TileRef> |
tiles |
|
EntityUid |
gridId |
|
Robust.Shared.Map.Components.MapGridComponent |
grid |
|
EventHorizonComponent |
eventHorizon |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
CanConsumeEntity(EntityUid, EntityUid, EventHorizonComponent)
Checks whether an event horizon can consume a given entity.
Declaration
public bool CanConsumeEntity(EntityUid hungry, EntityUid uid, EventHorizonComponent eventHorizon)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
CanConsumeTile(EntityUid, TileRef, MapGridComponent, EventHorizonComponent)
Checks whether an event horizon can consume a given tile.
This is only possible if it can also consume all entities anchored to the tile.
Declaration
public bool CanConsumeTile(EntityUid hungry, TileRef tile, MapGridComponent grid, EventHorizonComponent eventHorizon)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
Robust.Shared.Map.TileRef |
tile |
|
Robust.Shared.Map.Components.MapGridComponent |
grid |
|
EventHorizonComponent |
eventHorizon |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ConsumeEntitiesInContainer(EntityUid, BaseContainer, EventHorizonComponent, BaseContainer)
Attempts to consume all entities within a container.
Excludes the event horizon itself.
All immune entities within the container will be dumped to a given container or the map/grid if that is impossible.
Declaration
public void ConsumeEntitiesInContainer(EntityUid hungry, BaseContainer container, EventHorizonComponent eventHorizon, BaseContainer outerContainer = null)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
Robust.Shared.Containers.BaseContainer |
container |
|
EventHorizonComponent |
eventHorizon |
|
Robust.Shared.Containers.BaseContainer |
outerContainer |
|
|
Improve this Doc
View Source
ConsumeEntitiesInRange(EntityUid, Single, Nullable<TransformComponent>, EventHorizonComponent)
Attempts to consume all entities within a given distance of an entity;
Excludes the center entity.
Declaration
public void ConsumeEntitiesInRange(EntityUid uid, float range, TransformComponent? xform = null, EventHorizonComponent eventHorizon = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Single |
range |
|
System.Nullable<TransformComponent> |
xform |
|
EventHorizonComponent |
eventHorizon |
|
|
Improve this Doc
View Source
ConsumeEntity(EntityUid, EntityUid, EventHorizonComponent, BaseContainer)
Makes an event horizon consume a given entity.
Declaration
public void ConsumeEntity(EntityUid hungry, EntityUid morsel, EventHorizonComponent eventHorizon, BaseContainer outerContainer = null)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
EntityUid |
morsel |
|
EventHorizonComponent |
eventHorizon |
|
Robust.Shared.Containers.BaseContainer |
outerContainer |
|
|
Improve this Doc
View Source
ConsumeEverythingInRange(EntityUid, Single, Nullable<TransformComponent>, EventHorizonComponent)
Consumes most entities and tiles within a given distance of an entity.
Some entities are immune to consumption.
Declaration
public void ConsumeEverythingInRange(EntityUid uid, float range, TransformComponent? xform = null, EventHorizonComponent eventHorizon = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Single |
range |
|
System.Nullable<TransformComponent> |
xform |
|
EventHorizonComponent |
eventHorizon |
|
|
Improve this Doc
View Source
ConsumeTile(EntityUid, TileRef, EventHorizonComponent)
Makes an event horizon consume a specific tile on a grid.
Declaration
public void ConsumeTile(EntityUid hungry, TileRef tile, EventHorizonComponent eventHorizon)
Parameters
|
Improve this Doc
View Source
ConsumeTiles(EntityUid, List<(Vector2i, Tile)>, EntityUid, MapGridComponent, EventHorizonComponent)
Makes an event horizon consume a set of tiles on a grid.
Declaration
public void ConsumeTiles(EntityUid hungry, List<(Vector2i, Tile)> tiles, EntityUid gridId, MapGridComponent grid, EventHorizonComponent eventHorizon)
Parameters
Type |
Name |
Description |
EntityUid |
hungry |
|
List<System.ValueTuple<Vector2i, Robust.Shared.Map.Tile>> |
tiles |
|
EntityUid |
gridId |
|
Robust.Shared.Map.Components.MapGridComponent |
grid |
|
EventHorizonComponent |
eventHorizon |
|
|
Improve this Doc
View Source
ConsumeTilesInRange(EntityUid, Single, Nullable<TransformComponent>, EventHorizonComponent)
Consumes all tiles within a given distance of an entity.
Some entities are immune to consumption.
Declaration
public void ConsumeTilesInRange(EntityUid uid, float range, TransformComponent? xform, EventHorizonComponent eventHorizon)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Single |
range |
|
System.Nullable<TransformComponent> |
xform |
|
EventHorizonComponent |
eventHorizon |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
Overrides
|
Improve this Doc
View Source
PreventBreach<TComp>(EntityUid, TComp, ref EventHorizonAttemptConsumeEntityEvent)
A generic event handler that prevents singularities from breaching containment.
In this case 'breaching containment' means consuming an entity with a component of the given type unless the event horizon is set to breach containment anyway.
Declaration
public static void PreventBreach<TComp>(EntityUid uid, TComp comp, ref EventHorizonAttemptConsumeEntityEvent args)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
TComp |
comp |
|
Content.Server.Singularity.Events.EventHorizonAttemptConsumeEntityEvent |
args |
|
Type Parameters
|
Improve this Doc
View Source
PreventCollide(EntityUid, EventHorizonComponent, ref PreventCollideEvent)
Prevents a singularity from colliding with anything it is incapable of consuming.
Declaration
protected override bool PreventCollide(EntityUid uid, EventHorizonComponent comp, ref PreventCollideEvent args)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EventHorizonComponent |
comp |
|
Robust.Shared.Physics.Events.PreventCollideEvent |
args |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
PreventConsume<TComp>(EntityUid, TComp, ref EventHorizonAttemptConsumeEntityEvent)
A generic event handler that prevents singularities from consuming entities with a component of a given type if registered.
Declaration
public static void PreventConsume<TComp>(EntityUid uid, TComp comp, ref EventHorizonAttemptConsumeEntityEvent args)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
TComp |
comp |
|
Content.Server.Singularity.Events.EventHorizonAttemptConsumeEntityEvent |
args |
|
Type Parameters
|
Improve this Doc
View Source
SetConsumePeriod(EntityUid, TimeSpan, EventHorizonComponent)
Sets how often an event horizon will scan for overlapping entities to consume.
The value is specifically how long the subsystem should wait between scans.
If the new scanning period would have already prompted a scan given the previous scan time one is prompted immediately.
Declaration
public void SetConsumePeriod(EntityUid uid, TimeSpan value, EventHorizonComponent eventHorizon = null)
Parameters
|
Improve this Doc
View Source
Shutdown()
Declaration
public override void Shutdown()
Overrides
|
Improve this Doc
View Source
Update(EntityUid, EventHorizonComponent, Nullable<TransformComponent>)
Makes an event horizon consume everything nearby and resets the cooldown it for the next automated wave.
Declaration
public void Update(EntityUid uid, EventHorizonComponent eventHorizon = null, TransformComponent? xform = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
EventHorizonComponent |
eventHorizon |
|
System.Nullable<TransformComponent> |
xform |
|
|
Improve this Doc
View Source
Update(Single)
Updates the cooldowns of all event horizons.
If an event horizon are off cooldown this makes it consume everything within range and resets their cooldown.
Declaration
public override void Update(float frameTime)
Parameters
Type |
Name |
Description |
System.Single |
frameTime |
|