Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Script Namespace Reference

Classes

class  EventListener
 Script class. More...
 
class  ScriptDelegateSlot
 

Functions

EventListenerEventListenerFactory (asIScriptFunction *onevent, asIScriptFunction *ongeneric)
 

Function Documentation

◆ EventListenerFactory()

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

Definition at line 145 of file ScriptEventListener.h.

146 {
147 
148  EventListener* listener = NULL;
149 
150  try {
151 
152  listener = new EventListener(onevent, ongeneric);
153 
154  } catch(const InvalidArgument& e) {
155 
156  Logger::Get()->Error("Failed to construct Script::EventListener, exception: ");
157  e.PrintToLog();
158  }
159 
160  if(!listener) {
161 
162  // The object won't release the parameter references //
163  if(onevent)
164  onevent->Release();
165 
166  if(ongeneric)
167  ongeneric->Release();
168  }
169 
170  return listener;
171 }