IComponentManager API changes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
using Moq;
|
using Moq;
|
||||||
@@ -80,7 +80,7 @@ namespace Content.Benchmarks
|
|||||||
{
|
{
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
foreach (var _ in _componentManager.GetAllComponents<DummyComponent>())
|
foreach (var _ in _componentManager.EntityQuery<DummyComponent>())
|
||||||
{
|
{
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
|
|
||||||
private void UpdateAll()
|
private void UpdateAll()
|
||||||
{
|
{
|
||||||
foreach (var comp in EntityManager.ComponentManager.GetAllComponents<SubFloorHideComponent>())
|
foreach (var comp in EntityManager.ComponentManager.EntityQuery<SubFloorHideComponent>())
|
||||||
{
|
{
|
||||||
var gridId = comp.Owner.Transform.GridID;
|
var gridId = comp.Owner.Transform.GridID;
|
||||||
var grid = _mapManager.GetGrid(gridId);
|
var grid = _mapManager.GetGrid(gridId);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameObjects.Components.Markers;
|
using Content.Server.GameObjects.Components.Markers;
|
||||||
using Robust.Server.Interfaces.Console;
|
using Robust.Server.Interfaces.Console;
|
||||||
@@ -39,7 +39,7 @@ namespace Content.Server.Administration
|
|||||||
if (location == "?")
|
if (location == "?")
|
||||||
{
|
{
|
||||||
var locations = string.Join(", ",
|
var locations = string.Join(", ",
|
||||||
comp.GetAllComponents<WarpPointComponent>()
|
comp.EntityQuery<WarpPointComponent>()
|
||||||
.Select(p => p.Location)
|
.Select(p => p.Location)
|
||||||
.Where(p => p != null)
|
.Where(p => p != null)
|
||||||
.OrderBy(p => p)
|
.OrderBy(p => p)
|
||||||
@@ -59,7 +59,7 @@ namespace Content.Server.Administration
|
|||||||
var currentMap = player.AttachedEntity.Transform.MapID;
|
var currentMap = player.AttachedEntity.Transform.MapID;
|
||||||
var currentGrid = player.AttachedEntity.Transform.GridID;
|
var currentGrid = player.AttachedEntity.Transform.GridID;
|
||||||
|
|
||||||
var found = comp.GetAllComponents<WarpPointComponent>()
|
var found = comp.EntityQuery<WarpPointComponent>()
|
||||||
.Where(p => p.Location == location)
|
.Where(p => p.Location == location)
|
||||||
.Select(p => p.Owner.Transform.GridPosition)
|
.Select(p => p.Owner.Transform.GridPosition)
|
||||||
.OrderBy(p => p, Comparer<GridCoordinates>.Create((a, b) =>
|
.OrderBy(p => p, Comparer<GridCoordinates>.Create((a, b) =>
|
||||||
|
|||||||
@@ -1,21 +1,14 @@
|
|||||||
using Content.Server.GameObjects;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects.Systems;
|
|
||||||
|
|
||||||
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
|
namespace Content.Server.GameObjects.EntitySystems
|
||||||
{
|
{
|
||||||
class DoorSystem : EntitySystem
|
class DoorSystem : EntitySystem
|
||||||
{
|
{
|
||||||
public override void Initialize()
|
/// <inheritdoc />
|
||||||
{
|
|
||||||
EntityQuery = new TypeEntityQuery(typeof(ServerDoorComponent));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
foreach (var entity in RelevantEntities)
|
foreach (var comp in ComponentManager.EntityQuery<ServerDoorComponent>())
|
||||||
{
|
{
|
||||||
var comp = entity.GetComponent<ServerDoorComponent>();
|
|
||||||
comp.OnUpdate(frameTime);
|
comp.OnUpdate(frameTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace Content.Shared.GameObjects.Components.Movement
|
|||||||
TrySlip(collidedWith);
|
TrySlip(collidedWith);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(float frameTime)
|
public void Update()
|
||||||
{
|
{
|
||||||
foreach (var uid in _slipped.ToArray())
|
foreach (var uid in _slipped.ToArray())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using Content.Shared.GameObjects.Components.Movement;
|
using Content.Shared.GameObjects.Components.Movement;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
|
||||||
using Robust.Shared.GameObjects.Systems;
|
using Robust.Shared.GameObjects.Systems;
|
||||||
|
|
||||||
namespace Content.Shared.GameObjects.EntitySystems
|
namespace Content.Shared.GameObjects.EntitySystems
|
||||||
@@ -8,20 +7,12 @@ namespace Content.Shared.GameObjects.EntitySystems
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public class SlipperySystem : EntitySystem
|
public class SlipperySystem : EntitySystem
|
||||||
{
|
{
|
||||||
public override void Initialize()
|
/// <inheritdoc />
|
||||||
{
|
|
||||||
base.Initialize();
|
|
||||||
|
|
||||||
EntityQuery = new TypeEntityQuery(typeof(SharedSlipperyComponent));
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Update(float frameTime)
|
public override void Update(float frameTime)
|
||||||
{
|
{
|
||||||
base.Update(frameTime);
|
foreach (var slipperyComp in ComponentManager.EntityQuery<SharedSlipperyComponent>())
|
||||||
|
|
||||||
foreach (var entity in RelevantEntities)
|
|
||||||
{
|
{
|
||||||
entity.GetComponent<SharedSlipperyComponent>().Update(frameTime);
|
slipperyComp.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule RobustToolbox updated: 1de41531ce...350e05c152
Reference in New Issue
Block a user