using System; using System.Collections.Generic; namespace Robust.Shared.Interfaces.GameObjects.Components { /// /// A container is a way to "contain" entities inside other entities, in a logical way. /// This is alike BYOND's contents system, except more advanced. /// /// ///

/// Containers are logical separations of entities contained inside another entity. /// for example, a crate with two separated compartments would have two separate containers. /// If an entity inside compartment A drops something, /// the dropped entity would be placed in compartment A too, /// and compartment B would be completely untouched. ///

///

/// Containers are managed by an entity's , /// and have an ID to be referenced by. ///

///
/// public interface IContainer { /// /// The container manager owning this container. /// IContainerManager Manager { get; } /// /// The ID of this container. /// string ID { get; } /// /// The entity owning this container. /// IEntity Owner { get; } /// /// True if the container has been shut down via /// bool Deleted { get; } /// /// Readonly collection of all the entities contained within this specific container /// IReadOnlyCollection ContainedEntities { get; } /// /// Checks if the entity can be inserted into this container. /// /// The entity to attempt to insert. /// True if the entity can be inserted, false otherwise. bool CanInsert(IEntity toinsert); /// /// Attempts to insert the entity into this container. /// /// /// If the insertion is successful, the inserted entity will end up parented to the /// container entity, and the inserted entity's local position will be set to the zero vector. /// /// The entity to insert. /// False if the entity could not be inserted. /// /// Thrown if this container is a child of the entity, /// which would cause infinite loops. /// bool Insert(IEntity toinsert); /// /// Checks if the entity can be removed from this container. /// /// The entity to check. /// True if the entity can be removed, false otherwise. bool CanRemove(IEntity toremove); /// /// Attempts to remove the entity from this container. /// /// The entity to attempt to remove. /// True if the entity was removed, false otherwise. bool Remove(IEntity toremove); void ForceRemove(IEntity toRemove); /// /// Checks if the entity is contained in this container. /// This is not recursive, so containers of children are not checked. /// /// The entity to check. /// True if the entity is immediately contained in this container, false otherwise. bool Contains(IEntity contained); /// /// Clears the container and marks it as deleted. /// void Shutdown(); } }