Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Script Namespace Reference

Classes

class  EventListener
 An EventListener that scripts can use to listen for events. More...
 
class  ScriptDelegateSlot
 

Functions

EventListenerEventListenerFactory (asIScriptFunction *onevent, asIScriptFunction *ongeneric)
 

Function Documentation

◆ EventListenerFactory()

EventListener* Leviathan::Script::EventListenerFactory ( asIScriptFunction *  onevent,
asIScriptFunction *  ongeneric 
)

Definition at line 117 of file ScriptEventListener.h.

118 {
119  EventListener* listener = nullptr;
120 
121  try {
122 
123  listener = new EventListener(onevent, ongeneric);
124 
125  } catch(const InvalidArgument& e) {
126 
127  Logger::Get()->Error("Failed to construct Script::EventListener, exception: ");
128  e.PrintToLog();
129  }
130 
131  if(!listener) {
132 
133  // The object won't release the parameter references //
134  if(onevent)
135  onevent->Release();
136 
137  if(ongeneric)
138  ongeneric->Release();
139  }
140 
141  return listener;
142 }