Beispiel #1
0
 public void Reset(FECgTime timeType)
 {
     TimeSinceStart[timeType]   = 0.0f;
     DeltaTime[timeType]        = 0.0f;
     FramesSinceStart[timeType] = 0;
     bPaused[timeType]          = false;
 }
Beispiel #2
0
        public void Update(FECgTime time)
        {
            float deltaTime = Time.realtimeSinceStartup - LastRealtimeSinceStartup[time];

            if (!bPaused[time])
            {
                TimeSinceStart[time]   += deltaTime;
                DeltaTime[time]         = deltaTime;
                FramesSinceStart[time] += 1;
            }
            else
            {
                DeltaTime[time] = 0.0f;
            }
            LastRealtimeSinceStartup[time] = Time.realtimeSinceStartup;
        }
Beispiel #3
0
        public TCgManager_PooledMonoObjects_Map()
        {
            TimeType = ECgTime.Update;

            PoolSizes     = new Dictionary <EnumType, int>(new FEnumTypeEqualityComparer());
            Pool          = new List <ObjectType>();
            Pools         = new Dictionary <EnumType, List <ObjectType> >(new FEnumTypeEqualityComparer());
            PoolIndices   = new Dictionary <EnumType, int>(new FEnumTypeEqualityComparer());
            ActiveObjects = new Dictionary <EnumType, Dictionary <int, ObjectType> >(new FEnumTypeEqualityComparer());

            Payloads = new List <PayloadType>();

            ConstructObject = new FExecute_ConstructObject();
            ConstructObject.Bind(ConstructObject_Internal);

            OnAddToPool_Event = new FOnAddToPool();
        }
Beispiel #4
0
        public FCgManager_Time()
        {
            LastRealtimeSinceStartup = new Dictionary <FECgTime, float>(new FECgTimeEqualityComparer());
            TimeSinceStart           = new Dictionary <FECgTime, float>(new FECgTimeEqualityComparer());
            DeltaTime        = new Dictionary <FECgTime, float>(new FECgTimeEqualityComparer());
            FramesSinceStart = new Dictionary <FECgTime, ulong>(new FECgTimeEqualityComparer());
            bPaused          = new Dictionary <FECgTime, bool>(new FECgTimeEqualityComparer());

            int count = EMCgTime.Get().Count;

            for (int i = 0; i < count; ++i)
            {
                FECgTime e = EMCgTime.Get().GetEnumAt(i);

                LastRealtimeSinceStartup.Add(e, 0.0f);
                TimeSinceStart.Add(e, 0.0f);
                DeltaTime.Add(e, 0.0f);
                FramesSinceStart.Add(e, 0);
                bPaused.Add(e, false);
            }
        }
Beispiel #5
0
 public void SetTimeType(FECgTime timeType)
 {
     TimeType = timeType;
 }
Beispiel #6
0
        public FCgManager_Trace()
        {
            TimeType = ECgTime.Update;

            RequestsProcessedPerTick = MAX_REQUESTS_PROCESSED_PER_TICK;

            TraceCountLifetimeByObjectId = new Dictionary <ulong, ulong>();

            TraceCountLifetimeByType = new ulong[TRACE_TYPE_MAX];

            for (byte i = 0; i < TRACE_TYPE_MAX; ++i)
            {
                TraceCountLifetimeByType[i] = 0;
            }

            TraceCountLifetimeByMethod = new ulong[TRACE_METHOD_MAX];

            for (byte i = 0; i < TRACE_METHOD_MAX; ++i)
            {
                TraceCountLifetimeByMethod[i] = 0;
            }

            TraceCountLifetimeByObjectId = new Dictionary <ulong, ulong>();

            TraceCountThisFrameByObjectId = new Dictionary <ulong, ushort>();

            TraceCountThisFrameByType = new ushort[TRACE_TYPE_MAX];

            for (byte i = 0; i < TRACE_TYPE_MAX; ++i)
            {
                TraceCountThisFrameByType[i] = 0;
            }

            TraceCountThisFrameByMethod = new ushort[TRACE_METHOD_MAX];

            for (byte i = 0; i < TRACE_METHOD_MAX; ++i)
            {
                TraceCountThisFrameByMethod[i] = 0;
            }

            Requests = new FCgTraceRequest[REQUEST_SIZE];

            for (byte i = 0; i < REQUEST_SIZE; ++i)
            {
                Requests[i] = new FCgTraceRequest(i);
            }

            RequestIndex = 0;

            PendingRequests = new LinkedList <FCgTraceRequest>();

            PendingRequestMap         = new Dictionary <byte, FCgTraceRequest>();
            PendingRequestsByTraceId  = new Dictionary <ulong, FCgTraceRequest>();
            PendingRequestsByObjectId = new Dictionary <ulong, Dictionary <byte, FCgTraceRequest> >();
            PendingRequestsByType     = new Dictionary <ECgTraceType, Dictionary <byte, FCgTraceRequest> >(new ECgTraceTypeEqualityComparer());

            for (byte i = 0; i < TRACE_TYPE_MAX; ++i)
            {
                Dictionary <byte, FCgTraceRequest> addMap = new Dictionary <byte, FCgTraceRequest>();
                PendingRequestsByType.Add((ECgTraceType)i, addMap);
            }

            PendingRequestsByMethod = new Dictionary <ECgTraceMethod, Dictionary <byte, FCgTraceRequest> >(new ECgTraceMethodEqualityComparer());

            for (byte i = 0; i < TRACE_METHOD_MAX; ++i)
            {
                Dictionary <byte, FCgTraceRequest> addMap = new Dictionary <byte, FCgTraceRequest>();
                PendingRequestsByMethod.Add((ECgTraceMethod)i, addMap);
            }

            Responses = new FCgTraceResponse[RESPONSE_SIZE];

            for (int i = 0; i < RESPONSE_SIZE; ++i)
            {
                Responses[i] = new FCgTraceResponse();
            }

            ResponseIndex = 0;
        }
Beispiel #7
0
 public void UnPause(FECgTime timeType)
 {
     bPaused[timeType] = false;
 }
Beispiel #8
0
 public void Pause(FECgTime timeType)
 {
     bPaused[timeType] = true;
 }
Beispiel #9
0
 public ulong GetFramesSinceStart(FECgTime timeType)
 {
     return(FramesSinceStart[timeType]);
 }
Beispiel #10
0
 public float GetTimeSinceStart(FECgTime timeType)
 {
     return(TimeSinceStart[timeType]);
 }
Beispiel #11
0
 public float GetDeltaTime(FECgTime timeType)
 {
     return(DeltaTime[timeType]);
 }
Beispiel #12
0
 public void SetTimeType(FECgTime timeType)
 {
     Internal.TimeType = timeType;
 }