Anvil
Anvil.API.CallInfo Class Reference

Meta information for script calls, consumed by ScriptHandler attributed methods in service classes. More...

Public Member Functions

 CallInfo (string scriptName, NwObject? objSelf)
 
bool TryGetEvent< TEvent > ([NotNullWhen(true)] out TEvent? eventData)
 Attempts to get the current running event. More...
 

Properties

NwObjectObjectSelf [get]
 Gets the object that is currently running on this script. More...
 
string ScriptName [get]
 Gets the name of the script that is being executing. More...
 
ScriptParams ScriptParams [get]
 Gets the parameters set for this script call.
NOTE: variable values are NOT guaranteed outside of this script context, and must be read before any async method/lambda is invoked. More...
 
EventScriptType ScriptType [get]
 Gets the event that triggered the execution of this script. More...
 

Detailed Description

Meta information for script calls, consumed by ScriptHandler attributed methods in service classes.

Member Function Documentation

◆ TryGetEvent< TEvent >()

bool Anvil.API.CallInfo.TryGetEvent< TEvent > ( [NotNullWhen(true)] out TEvent?  eventData)
inline

Attempts to get the current running event.

Parameters
eventDataWhen this method returns, contains the created event if the current event is a TEvent. Otherwise, returns the default value for TEvent.
Template Parameters
TEventThe expected event type. Only events attributed with GameEventAttribute are supported.
Returns
true if the current running script is a TEvent, otherwise false.
Type Constraints
TEvent :IEvent 
TEvent :new() 

Property Documentation

◆ ObjectSelf

NwObject? Anvil.API.CallInfo.ObjectSelf
get

Gets the object that is currently running on this script.

◆ ScriptName

string Anvil.API.CallInfo.ScriptName
get

Gets the name of the script that is being executing.

◆ ScriptParams

ScriptParams Anvil.API.CallInfo.ScriptParams
get

Gets the parameters set for this script call.
NOTE: variable values are NOT guaranteed outside of this script context, and must be read before any async method/lambda is invoked.

◆ ScriptType

EventScriptType Anvil.API.CallInfo.ScriptType
get

Gets the event that triggered the execution of this script.


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