public void RemoveEntitiesFromGroup(ExclusiveBuildGroup groupID, [CallerMemberName] string caller = null) { DBC.ECS.Check.Require(groupID.isInvalid == false, "invalid group detected"); _enginesRoot.Target.RemoveGroupID(groupID); _enginesRoot.Target.QueueRemoveGroupOperation(groupID, caller); }
public void SwapEntity(EGID from, ExclusiveBuildGroup to, int threadIndex) { var simpleNativeBag = _swapQueue.GetBuffer(threadIndex); simpleNativeBag.Enqueue(_indexSwap); simpleNativeBag.Enqueue(new DoubleEGID(from, new EGID(from.entityID, to))); }
public EntityInitializer BuildEntity <T> (uint entityID, ExclusiveBuildGroup groupStructId, T descriptorEntity, IEnumerable <object> implementors) where T : IEntityDescriptor { return(_enginesRoot.Target.BuildEntity(new EGID(entityID, groupStructId) , descriptorEntity.componentsToBuild, TypeCache <T> .type, implementors)); }
public EntityInitializer BuildEntity <T> (uint entityID, ExclusiveBuildGroup groupStructId, IEnumerable <object> implementors = null , [CallerMemberName] string caller = null) where T : IEntityDescriptor, new() { return(_enginesRoot.Target.BuildEntity(new EGID(entityID, groupStructId) , EntityDescriptorTemplate <T> .descriptor.componentsToBuild , TypeCache <T> .type, implementors, caller)); }
public void RemoveEntitiesFromGroup(ExclusiveBuildGroup groupID) { DBC.ECS.Check.Require(groupID != 0, "invalid group detected"); _enginesRoot.Target.RemoveGroupID(groupID); _enginesRoot.Target.QueueEntitySubmitOperation( new EntitySubmitOperation(EntitySubmitOperationType.RemoveGroup, new EGID(0, groupID), new EGID())); }
public void SwapEntityGroup <T>(EGID fromID, EGID toID, ExclusiveBuildGroup mustBeFromGroup) where T : IEntityDescriptor, new() { if (fromID.groupID != mustBeFromGroup) { throw new ECSException($"Entity is not coming from the expected group Expected {mustBeFromGroup} is {fromID.groupID}"); } SwapEntityGroup <T>(fromID, toID); }
public NativeEntityInitializer BuildEntity (uint eindex, ExclusiveBuildGroup exclusiveBuildGroup, int threadIndex) { NativeBag unsafeBuffer = _addOperationQueue.GetBuffer(threadIndex + 1); unsafeBuffer.Enqueue(_index); unsafeBuffer.Enqueue(new EGID(eindex, exclusiveBuildGroup)); unsafeBuffer.ReserveEnqueue <uint>(out var index) = 0; return(new NativeEntityInitializer(unsafeBuffer, index)); }
public void SwapEntityGroup <T> (EGID fromEGID, EGID toEGID, ExclusiveBuildGroup mustBeFromGroup, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new() { if (fromEGID.groupID != mustBeFromGroup) { throw new ECSException( $"Entity is not coming from the expected group Expected {mustBeFromGroup} is {fromEGID.groupID}"); } SwapEntityGroup <T>(fromEGID, toEGID, caller); }
public void SwapEntitiesInGroup (ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID, [CallerMemberName] string caller = null) { if (_enginesRoot.Target._groupEntityComponentsDB.TryGetValue( fromGroupID.group , out FasterDictionary <RefWrapperType, ITypeSafeDictionary> entitiesInGroupPerType) == true) { #if DEBUG && !PROFILE_SVELTO ITypeSafeDictionary dictionary = entitiesInGroupPerType.unsafeValues[0]; dictionary.KeysEvaluator((key) => { _enginesRoot.Target.CheckRemoveEntityID(new EGID(key, fromGroupID), null, caller); _enginesRoot.Target.CheckAddEntityID(new EGID(key, toGroupID), null, caller); }); #endif _enginesRoot.Target.QueueSwapGroupOperation(fromGroupID, toGroupID, caller); } }
public void SwapEntitiesInGroup <T>(ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID) where T : IEntityDescriptor, new() { if (_enginesRoot.Target._groupEntityComponentsDB.TryGetValue( fromGroupID.group, out FasterDictionary <RefWrapperType, ITypeSafeDictionary> entitiesInGroupPerType) == true) { #if DEBUG && !PROFILE_SVELTO IComponentBuilder[] components = EntityDescriptorTemplate <T> .descriptor.componentsToBuild; var dictionary = entitiesInGroupPerType[new RefWrapperType(components[0].GetEntityComponentType())]; dictionary.KeysEvaluator((key) => { _enginesRoot.Target.CheckRemoveEntityID(new EGID(key, fromGroupID), TypeCache <T> .type); _enginesRoot.Target.CheckAddEntityID(new EGID(key, toGroupID), TypeCache <T> .type); }); #endif _enginesRoot.Target.QueueEntitySubmitOperation( new EntitySubmitOperation(EntitySubmitOperationType.SwapGroup, new EGID(0, fromGroupID) , new EGID(0, toGroupID))); } }
public void RemoveEntity <T>(uint entityID, ExclusiveBuildGroup groupID) where T : IEntityDescriptor, new() { RemoveEntity <T>(new EGID(entityID, groupID)); }
public void RemoveEntity <T> (uint entityID, ExclusiveBuildGroup groupID, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new() { RemoveEntity <T>(new EGID(entityID, groupID), caller); }
public void SwapEntityGroup <T>(EGID fromID, ExclusiveBuildGroup toGroupID) where T : IEntityDescriptor, new() { SwapEntityGroup <T>(fromID, new EGID(fromID.entityID, (uint)toGroupID)); }
public void SwapEntityGroup <T> (uint entityID, ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID , [CallerMemberName] string caller = null) where T : IEntityDescriptor, new() { SwapEntityGroup <T>(new EGID(entityID, fromGroupID), toGroupID, caller); }
public void SwapEntityGroup <T> (EGID fromEGID, ExclusiveBuildGroup toGroupID, [CallerMemberName] string caller = null) where T : IEntityDescriptor, new() { SwapEntityGroup <T>(fromEGID, new EGID(fromEGID.entityID, toGroupID), caller); }
public void AddSwapGroupOperation(ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID, string caller) { _thisSubmissionInfo._groupsToSwap.Add((fromGroupID, toGroupID, caller)); }
void QueueSwapGroupOperation(ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID, string caller) { _entitiesOperations.AddSwapGroupOperation(fromGroupID, toGroupID, caller); }
public void SwapEntityGroup <T>(uint entityID, ExclusiveBuildGroup fromGroupID, ExclusiveBuildGroup toGroupID) where T : IEntityDescriptor, new() { SwapEntityGroup <T>(new EGID(entityID, fromGroupID), toGroupID); }
public EGID(uint entityID, ExclusiveBuildGroup groupID) : this() { _GID = MAKE_GLOBAL_ID(entityID, groupID.group); }
public void AddRemoveGroupOperation(ExclusiveBuildGroup groupID, string caller) { _thisSubmissionInfo._groupsToRemove.Add((groupID, caller)); }
void RemoveGroupID(ExclusiveBuildGroup groupID) { _idChecker.Remove(groupID); }
void QueueRemoveGroupOperation(ExclusiveBuildGroup groupID, string caller) { _entitiesOperations.AddRemoveGroupOperation(groupID, caller); }