예제 #1
0
        void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation)
        {
#if DEBUG && !PROFILE_SVELTO
            entitySubmitOperation.trace = new System.Diagnostics.StackFrame(1, true);
#endif
            _entitiesOperations.Add((ulong)entitySubmitOperation.fromID, entitySubmitOperation);
        }
        void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation)
        {
#if DEBUG && !PROFILER
            entitySubmitOperation.trace = Environment.StackTrace;
#endif
            _entitiesOperations.Add((ulong)entitySubmitOperation.fromID, ref entitySubmitOperation);
        }
        void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation)
        {
#if DEBUG && !PROFILER
            entitySubmitOperation.trace = new StackFrame(1, true);
#endif
            _entitiesOperations.Add((ulong)entitySubmitOperation.fromID, entitySubmitOperation);
        }
예제 #4
0
        void QueueEntitySubmitOperation(EntitySubmitOperation entitySubmitOperation)
        {
#if DEBUG
            entitySubmitOperation.trace = Environment.StackTrace;
#endif
            _entitiesOperations.AddRef(ref entitySubmitOperation);
        }
        void QueueEntitySubmitOperation <T>(EntitySubmitOperation entitySubmitOperation) where T : IEntityDescriptor
        {
#if DEBUG && !PROFILER
            entitySubmitOperation.trace = Environment.StackTrace;
            var egid = new EGID(entitySubmitOperation.ID, entitySubmitOperation.fromGroupID);
            if (_entitiesOperationsDebug.ContainsKey((long)egid) == true)
            {
                Console.LogError("Only one entity operation per submission is allowed. Entity "
                                 .FastConcat(" with not found ID is about to be removed: ")
                                 .FastConcat(" id: ")
                                 .FastConcat(entitySubmitOperation.ID)
                                 .FastConcat(" groupid: ")
                                 .FastConcat(entitySubmitOperation.fromGroupID)
                                 //.FastConcat(entitySubmitOperation.fromGroupID.GetType().Name)); do this later
                                 .FastConcat(" entityType: ")
                                 .FastConcat(typeof(T).Name)
                                 .FastConcat(" submission type ", entitySubmitOperation.type.ToString(),
                                             " previous type: ", _entitiesOperationsDebug[(long)egid].ToString()));
            }
            else
            {
                _entitiesOperationsDebug[(long)egid] = entitySubmitOperation.type;
            }
#endif
            _entitiesOperations.AddRef(ref entitySubmitOperation);
        }
        void QueueEntitySubmitOperation <T>(EntitySubmitOperation entitySubmitOperation) where T : IEntityDescriptor
        {
#if DEBUG && !PROFILER
            entitySubmitOperation.trace = Environment.StackTrace;

            if (_entitiesOperations.TryGetValue((ulong)entitySubmitOperation.fromID, out var entitySubmitedOperation) == true)
            {
                if (entitySubmitedOperation != entitySubmitOperation)
                {
                    Console.LogError("Only one entity operation per submission is allowed".FastConcat(" entityViewType: ")
                                     .FastConcat(typeof(T).Name)
                                     .FastConcat(" submission type ", entitySubmitOperation.type.ToString(),
                                                 " previous operation type: ",
                                                 _entitiesOperations[(ulong)entitySubmitOperation.fromID].type
                                                 .ToString()));
                }
            }
            else
#endif
            _entitiesOperations.Set((ulong)entitySubmitOperation.fromID, ref entitySubmitOperation);
        }
예제 #7
0
        void QueueEntitySubmitOperation <T>(EntitySubmitOperation entitySubmitOperation) where T : IEntityDescriptor
        {
#if DEBUG && !PROFILE_SVELTO
            entitySubmitOperation.trace = new System.Diagnostics.StackFrame(1, true);

            if (_entitiesOperations.TryGetValue((ulong)entitySubmitOperation.fromID, out var entitySubmitedOperation))
            {
                if (entitySubmitedOperation != entitySubmitOperation)
                {
                    throw new ECSException("Only one entity operation per submission is allowed"
                                           .FastConcat(" entityComponentType: ")
                                           .FastConcat(typeof(T).Name)
                                           .FastConcat(" submission type ", entitySubmitOperation.type.ToString(),
                                                       " from ID: ", entitySubmitOperation.fromID.entityID.ToString())
                                           .FastConcat(" previous operation type: ",
                                                       _entitiesOperations[(ulong)entitySubmitOperation.fromID].type
                                                       .ToString()));
                }
            }
            else
#endif
            _entitiesOperations.Set((ulong)entitySubmitOperation.fromID, entitySubmitOperation);
        }