using System; using Svelto.ECS.Internal; namespace Svelto.ECS { public interface IReactEngine : IEngine { } /// /// This is now considered legacy and it will be deprecated in future /// public interface IReactOnAdd : IReactEngine { } /// /// This is now considered legacy and it will be deprecated in future /// public interface IReactOnRemove : IReactEngine { } /// /// This is now considered legacy and it will be deprecated in future /// public interface IReactOnSwap : IReactEngine { } /// /// This is now considered legacy and it will be deprecated in future /// public interface IReactOnDispose : IReactEngine { } public interface IReactOnAddEx : IReactEngine { } public interface IReactOnRemoveEx : IReactEngine { } public interface IReactOnSwapEx : IReactEngine { } public interface IReactOnDisposeEx : IReactEngine { } } namespace Svelto.ECS { public interface IEngine { } public interface IGetReadyEngine : IEngine { //Ready is a callback that can be used to signal that the engine is ready to be used because the entitiesDB is now available void Ready(); } public interface IQueryingEntitiesEngine : IGetReadyEngine { EntitiesDB entitiesDB { set; } } /// /// Interface to mark an Engine as reacting on entities added /// /// [Obsolete] public interface IReactOnAdd : IReactOnAdd where T : _IInternalEntityComponent { void Add(ref T entityComponent, EGID egid); } public interface IReactOnAddEx : IReactOnAddEx where T : struct, _IInternalEntityComponent { void Add((uint start, uint end) rangeOfEntities, in EntityCollection entities, ExclusiveGroupStruct groupID); } /// /// Interface to mark an Engine as reacting on entities removed /// /// [Obsolete] public interface IReactOnRemove : IReactOnRemove where T : _IInternalEntityComponent { void Remove(ref T entityComponent, EGID egid); } public interface IReactOnAddAndRemoveEx : IReactOnAddEx, IReactOnRemoveEx where T : struct, _IInternalEntityComponent { } public interface IReactOnRemoveEx : IReactOnRemoveEx where T : struct, _IInternalEntityComponent { void Remove((uint start, uint end) rangeOfEntities, in EntityCollection entities, ExclusiveGroupStruct groupID); } [Obsolete("Use IReactOnAddEx and IReactOnRemoveEx or IReactOnAddAndRemoveEx instead")] public interface IReactOnAddAndRemove : IReactOnAdd, IReactOnRemove where T : _IInternalEntityComponent { } /// /// Interface to mark an Engine as reacting on engines root disposed. /// It can work together with IReactOnRemove which normally is not called on enginesroot disposed /// /// [Obsolete("Use IReactOnDisposeEx instead")] public interface IReactOnDispose : IReactOnDispose where T : _IInternalEntityComponent { void Remove(ref T entityComponent, EGID egid); } /// /// Interface to mark an Engine as reacting to entities swapping group /// /// [Obsolete("Use IReactOnSwapEx instead")] public interface IReactOnSwap : IReactOnSwap where T : _IInternalEntityComponent { void MovedTo(ref T entityComponent, ExclusiveGroupStruct previousGroup, EGID egid); } /// /// All the entities have been already submitted in the database (swapped) when this callback is triggered /// /// public interface IReactOnSwapEx : IReactOnSwapEx where T : struct, _IInternalEntityComponent { void MovedTo((uint start, uint end) rangeOfEntities, in EntityCollection entities, ExclusiveGroupStruct fromGroup, ExclusiveGroupStruct toGroup); } public interface IReactOnDisposeEx : IReactOnDisposeEx where T : struct, _IInternalEntityComponent { void Remove((uint start, uint end) rangeOfEntities, in EntityCollection entities, ExclusiveGroupStruct groupID); } /// /// Interface to mark an Engine as reacting after each entities submission phase /// public interface IReactOnSubmission : IReactEngine { void EntitiesSubmitted(); } public interface IReactOnSubmissionStarted : IReactEngine { void EntitiesSubmissionStarting(); } }