From 3101ec1985257231e200aaceee5271de84e35021 Mon Sep 17 00:00:00 2001 From: Vera Aguilera Puerto Date: Mon, 10 May 2021 20:25:54 +0200 Subject: [PATCH] Mark IEntityQuery and implementing classes as obsolete. --- Robust.Shared/GameObjects/EntityQuery.cs | 12 ++++++------ Robust.Shared/GameObjects/IEntityQuery.cs | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Robust.Shared/GameObjects/EntityQuery.cs b/Robust.Shared/GameObjects/EntityQuery.cs index e923740b30..8510825f24 100644 --- a/Robust.Shared/GameObjects/EntityQuery.cs +++ b/Robust.Shared/GameObjects/EntityQuery.cs @@ -11,7 +11,7 @@ namespace Robust.Shared.GameObjects /// An entity query that will let all entities pass. /// This is the same as matching ITransformComponent, but faster. /// - [PublicAPI] + [PublicAPI, Obsolete] public class AllEntityQuery : IEntityQuery { /// @@ -28,7 +28,7 @@ namespace Robust.Shared.GameObjects /// An entity query which will match entities based on a predicate. /// If you only want a single type of Component, use TypeEntityQuery. /// - [PublicAPI] + [PublicAPI, Obsolete] public class PredicateEntityQuery : IEntityQuery { private readonly Predicate Predicate; @@ -59,7 +59,7 @@ namespace Robust.Shared.GameObjects /// An entity query that will match one type of component. /// This the fastest and most common query, and should be the default choice. /// - [PublicAPI] + [PublicAPI, Obsolete] public class TypeEntityQuery : IEntityQuery { private readonly Type ComponentType; @@ -90,7 +90,7 @@ namespace Robust.Shared.GameObjects /// This the fastest and most common query, and should be the default choice. /// /// Type of component to match. - [PublicAPI] + [PublicAPI, Obsolete] public class TypeEntityQuery : IEntityQuery where T : IComponent { public bool Match(IEntity entity) => entity.HasComponent(); @@ -104,7 +104,7 @@ namespace Robust.Shared.GameObjects /// /// An entity query that will match all entities that intersect with the argument entity. /// - [PublicAPI] + [PublicAPI, Obsolete] public class IntersectingEntityQuery : IEntityQuery { private readonly IEntity Entity; @@ -137,7 +137,7 @@ namespace Robust.Shared.GameObjects /// /// An entity query that will match entities that have all of the provided components. /// - [PublicAPI] + [PublicAPI, Obsolete] public class MultipleTypeEntityQuery : IEntityQuery { private readonly List ComponentTypes; diff --git a/Robust.Shared/GameObjects/IEntityQuery.cs b/Robust.Shared/GameObjects/IEntityQuery.cs index f896a11e31..522ff132e8 100644 --- a/Robust.Shared/GameObjects/IEntityQuery.cs +++ b/Robust.Shared/GameObjects/IEntityQuery.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Robust.Shared.GameObjects { @@ -6,6 +7,7 @@ namespace Robust.Shared.GameObjects /// An entity query is a type that can filter entities based on certain criteria, /// for example based on the components that the entity has. /// + [Obsolete("Use any of the other entity query methods instead.")] public interface IEntityQuery { ///