using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Robust.Shared.GameObjects; namespace Robust.Shared.Containers { /// /// Manages containers on an entity. /// /// public interface IContainerManager : IComponent { /// /// Makes a new container of the specified type. /// /// The ID for the new container. /// The type of the new container /// The new container. /// Thrown if there already is a container with the specified ID T MakeContainer(string id) where T : IContainer; /// /// Attempts to remove contained inside the owning entity, /// finding the container containing it automatically, if it is actually contained. /// /// The entity to remove. /// True if the entity was successfuly removed. bool Remove(EntityUid entity); /// /// Gets the container with the specified ID. /// /// The ID to look up. /// The container. /// Thrown if the container does not exist. IContainer GetContainer(string id); /// /// Checks whether we have a container with the specified ID. /// /// The entity ID to check. /// True if we already have a container, false otherwise. bool HasContainer(string id); /// /// Attempt to retrieve a container with specified ID. /// /// The ID to look up. /// The container if it was found, null if not found. /// True if the container was found, false otherwise. bool TryGetContainer(string id, [NotNullWhen(true)] out IContainer? container); /// /// Attempt to retrieve a container that contains a specific entity. /// /// The entity that is inside the container. /// The container if it was found, null if not found. /// True if the container was found, false otherwise. /// True if the container was found, false otherwise. bool TryGetContainer(EntityUid entity, [NotNullWhen(true)] out IContainer? container); bool ContainsEntity(EntityUid entity); void ForceRemove(EntityUid entity); /// /// DO NOT CALL THIS DIRECTLY. Call instead. /// void InternalContainerShutdown(IContainer container); } }