using System; using Robust.Shared.GameStates; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Timing; namespace Robust.Shared.GameObjects { /// /// The base interface for an ECS component. You probably want .
///
/// [ImplicitDataDefinitionForInheritors] [NotContentImplementable] public partial interface IComponent { /// /// The current lifetime stage of this component. You can use this to check /// if the component is initialized or being deleted. /// ComponentLifeStage LifeStage { get; internal set; } internal bool Networked { get; set; } /// /// Whether this component should be synchronized with clients when modified. /// If this is true, the server will synchronize all client instances with the data in this instance. /// If this is false, clients can modify the data in their instances without being overwritten by the server. /// This flag has no effect if is not defined on the component. /// This is enabled by default. /// bool NetSyncEnabled { get; set; } /// /// If true, and if this is a networked component, then component data will only be sent to players if their /// controlled entity is the owner of this component. This is less performance intensive than . /// bool SendOnlyToOwner { get; } /// /// If true, and if this is a networked component, then this component will cause events to be raised to check whether a given player should /// receive this component's state. /// bool SessionSpecific { get; } /// /// Entity that this component is attached to. /// /// [Obsolete("Update your API to allow accessing Owner through other means")] EntityUid Owner { get; set; } /// /// Whether the component has been or is being initialized. /// /// bool Initialized { get; } /// /// This is true when the component is active. /// /// bool Running { get; } /// /// True if the component has been removed from its owner, AKA deleted. /// /// bool Deleted { get; } /// /// Marks the component as dirty so that the network will re-sync it with clients. /// [Obsolete] void Dirty(IEntityManager? entManager = null); /// /// This is the tick the component was created. /// GameTick CreationTick { get; internal set; } /// /// This is the last game tick Dirty() was called. /// GameTick LastModifiedTick { get; internal set; } internal void ClearTicks(); internal void ClearCreationTick(); } }