mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] TEngineServer
[+] TEngineServer
This commit is contained in:
31
Assets/GameScripts/DotNet/Core/TimerScheduler/TimerAction.cs
Normal file
31
Assets/GameScripts/DotNet/Core/TimerScheduler/TimerAction.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using TEngine.Core;
|
||||
#pragma warning disable CS8625
|
||||
#pragma warning disable CS8618
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
public sealed class TimerAction : IDisposable
|
||||
{
|
||||
public long Id;
|
||||
public long Time;
|
||||
public object Callback;
|
||||
public TimerType TimerType;
|
||||
|
||||
public static TimerAction Create()
|
||||
{
|
||||
var timerAction = Pool<TimerAction>.Rent();
|
||||
timerAction.Id = IdFactory.NextRunTimeId();
|
||||
return timerAction;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Id = 0;
|
||||
Time = 0;
|
||||
Callback = null;
|
||||
TimerType = TimerType.None;
|
||||
Pool<TimerAction>.Return(this);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user