Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
GarbageSystem Interface Reference
Inheritance diagram for GarbageSystem:
[legend]

Public Member Functions

proto external bool Insert (notnull IEntity entity, float lifetime=-1, bool ignoreBlacklist=false)
 Requests the garbage handling of the provided entity.
 
proto external bool IsInserted (notnull IEntity entity)
 Check if the entity is tracked.
 
proto external bool Withdraw (notnull IEntity entity)
 Removes the provided entity from the garbage system.
 
proto external bool Bump (notnull IEntity entity, float additionalLifetime)
 Adds additional lifetime to the provided entity.
 
proto external float GetLifetime (notnull IEntity entity)
 Returns the original lifetime the provided entity was inserted with.
 
proto external float GetRemainingLifetime (notnull IEntity entity)
 Returns the remaining lifetime of the provided entity.
 
proto external void Flush (float minTrackedSeconds=30)
 Forcefully disposes all entities that are tracked at least for x seconds.
 
proto external bool UpdateBlacklist (notnull IEntity entity, bool blacklisted)
 Determine if the provided entity instance is blacklisted from being inserted.
 
proto external int GetTrackedEntities (notnull array< IEntity > entities)
 Get all entities tracked by the garbage system. Expensive operation. Use with care!
 
- Public Member Functions inherited from GameSystem
bool ShouldBePaused ()
 Is this system should be paused while the simulation is paused?
 
bool ShouldBeEnabledInEditMode ()
 Is this system should be enabled inside the editor.
 

Protected Member Functions

float OnInsertRequested (IEntity entity, float lifetime)
 
bool OnBeforeDelete (IEntity entity)
 

Member Function Documentation

◆ Bump()

proto external bool GarbageSystem.Bump ( notnull IEntity  entity,
float  additionalLifetime 
)

Adds additional lifetime to the provided entity.

Parameters
additionalLifetimeLifetime to add to current lifetime (in seconds)
Returns
Returns true on success, false if instance is not tracked.

◆ Flush()

proto external void GarbageSystem.Flush ( float  minTrackedSeconds = 30)

Forcefully disposes all entities that are tracked at least for x seconds.

◆ GetLifetime()

proto external float GarbageSystem.GetLifetime ( notnull IEntity  entity)

Returns the original lifetime the provided entity was inserted with.

Returns
Lifetime duration in seconds or -1 if not tracked..

◆ GetRemainingLifetime()

proto external float GarbageSystem.GetRemainingLifetime ( notnull IEntity  entity)

Returns the remaining lifetime of the provided entity.

Note: Nearby players and their lifetime effect are only processed in the general system interval defined in the config. Thus the return value might briefly be 0 and jump back to a higher number in a later frame.

Returns
Remaining lifetime in seconds or -1 if not tracked.

◆ GetTrackedEntities()

proto external int GarbageSystem.GetTrackedEntities ( notnull array< IEntity >  entities)

Get all entities tracked by the garbage system. Expensive operation. Use with care!

◆ Insert()

proto external bool GarbageSystem.Insert ( notnull IEntity  entity,
float  lifetime = -1,
bool  ignoreBlacklist = false 
)

Requests the garbage handling of the provided entity.

Parameters
lifeTimeLife time of instance in seconds. If <= 0, the config rule values are used.
Returns
Returns true on success, false if instance is already or can not be inserted.

◆ IsInserted()

proto external bool GarbageSystem.IsInserted ( notnull IEntity  entity)

Check if the entity is tracked.

Returns
True if instance is tracked, false otherwise.

◆ OnBeforeDelete()

bool GarbageSystem.OnBeforeDelete ( IEntity  entity)
protected

◆ OnInsertRequested()

float GarbageSystem.OnInsertRequested ( IEntity  entity,
float  lifetime 
)
protected

Implemented in SCR_GarbageSystem.

◆ UpdateBlacklist()

proto external bool GarbageSystem.UpdateBlacklist ( notnull IEntity  entity,
bool  blacklisted 
)

Determine if the provided entity instance is blacklisted from being inserted.

Will withdraw the entity if it is currently tracked and blacklist was enabled for it. Can by bypassed via Insert(..., ignoreBlacklist: true)

Returns
True if blacklist update was successful, false otherwise.

◆ Withdraw()

proto external bool GarbageSystem.Withdraw ( notnull IEntity  entity)

Removes the provided entity from the garbage system.

Returns
True if successfull, false otherwise.

The documentation for this interface was generated from the following file: