C# 클래스 GarrysModLuaShared.timer

The timer library is a very useful set of functions which allow you to run a function periodically or after a given delay.
파일 보기 프로젝트 열기: OmegaExtern/gmod-csharp-binary-module

공개 메소드들

메소드 설명
Adjust ( LuaState luaState, object identifier, double delay, uint repetitions, lua_CFunction function ) : bool

Adjusts the timer if the timer with the given identifier exists.

Create ( LuaState luaState, object identifier, double delay, uint repetitions, lua_CFunction function ) : void

Creates a new timer.

Exists ( LuaState luaState, object identifier ) : bool

Returns whenever the given timer exists or not.

Pause ( LuaState luaState, object identifier ) : bool

Pauses the given timer.

Remove ( LuaState luaState, object identifier ) : void

Stops and removes the timer.

RepsLeft ( LuaState luaState, object identifier ) : uint

Returns amount of repetitions/executions left before the timer destroys itself.

Simple ( LuaState luaState, double delay, lua_CFunction function ) : void

Runs the given function after a specified delay.

Start ( LuaState luaState, object identifier ) : bool

Restarts the given timer.

Stop ( LuaState luaState, object identifier ) : bool

Stops the given timer.

TimeLeft ( LuaState luaState, object identifier ) : double

Returns amount of time left before the timer executes its function. If the timer is paused, the amount will be negative.

Toggle ( LuaState luaState, object identifier ) : bool

Runs either Pause or UnPause based on the timer's current status.

UnPause ( LuaState luaState, object identifier ) : bool

Unpauses the timer.

메소드 상세

Adjust() 공개 정적인 메소드

Adjusts the timer if the timer with the given identifier exists.
public static Adjust ( LuaState luaState, object identifier, double delay, uint repetitions, lua_CFunction function ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer to adjust.
delay double The delay interval in seconds.
repetitions uint Repetitions. Use 0 for infinite.
function lua_CFunction The new function.
리턴 bool

Create() 공개 정적인 메소드

Creates a new timer.
public static Create ( LuaState luaState, object identifier, double delay, uint repetitions, lua_CFunction function ) : void
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer to adjust.
delay double The delay interval in seconds.
repetitions uint The number of times to repeat the timer (use 0 for infinite repetitions).
function lua_CFunction Function to call when timer has finished the countdown.
리턴 void

Exists() 공개 정적인 메소드

Returns whenever the given timer exists or not.
public static Exists ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool

Pause() 공개 정적인 메소드

Pauses the given timer.
public static Pause ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool

Remove() 공개 정적인 메소드

Stops and removes the timer.
public static Remove ( LuaState luaState, object identifier ) : void
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer to remove.
리턴 void

RepsLeft() 공개 정적인 메소드

Returns amount of repetitions/executions left before the timer destroys itself.
public static RepsLeft ( LuaState luaState, object identifier ) : uint
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 uint

Simple() 공개 정적인 메소드

Runs the given function after a specified delay.
public static Simple ( LuaState luaState, double delay, lua_CFunction function ) : void
luaState LuaState Pointer to lua_State struct.
delay double How long until the function should be ran (in seconds).
function lua_CFunction The function to run after the specified delay.
리턴 void

Start() 공개 정적인 메소드

Restarts the given timer.
public static Start ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool

Stop() 공개 정적인 메소드

Stops the given timer.
public static Stop ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool

TimeLeft() 공개 정적인 메소드

Returns amount of time left before the timer executes its function. If the timer is paused, the amount will be negative.
public static TimeLeft ( LuaState luaState, object identifier ) : double
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 double

Toggle() 공개 정적인 메소드

Runs either Pause or UnPause based on the timer's current status.
public static Toggle ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool

UnPause() 공개 정적인 메소드

Unpauses the timer.
public static UnPause ( LuaState luaState, object identifier ) : bool
luaState LuaState Pointer to lua_State struct.
identifier object Identifier of the timer.
리턴 bool