Oolite 1.91.0.7668-250429-8542c40
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
PlayerEntity(OOJavaScriptExtensions) Category Reference

#include <EntityOOJavaScriptExtensions.h>

Instance Methods

(void) - setJSSelf:context:
 
(NSString *) - oo_jsClassName [implementation]
 
(void) - javaScriptEngineWillReset: [implementation]
 

Detailed Description

Definition at line 55 of file EntityOOJavaScriptExtensions.h.

Method Documentation

◆ javaScriptEngineWillReset:

- (void) javaScriptEngineWillReset: (NSNotification *) notification
implementation

Extends class PlayerEntity.

Definition at line 335 of file OOJSPlayerShip.m.

335 :(NSNotification *)notification
336{
337 [[NSNotificationCenter defaultCenter] removeObserver:self
338 name:kOOJavaScriptEngineWillResetNotification
340
341 if (_jsSelf != NULL)
342 {
343
344 JSContext *context = OOJSAcquireContext();
345 JS_RemoveObjectRoot(context, &_jsSelf);
346 _jsSelf = NULL;
347 OOJSRelinquishContext(context);
348 }
349}
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
OOJavaScriptEngine * sharedEngine()

References OOJSAcquireContext(), OOJSRelinquishContext(), and OOJavaScriptEngine::sharedEngine.

+ Here is the call graph for this function:

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Extends class PlayerEntity.

Definition at line 317 of file OOJSPlayerShip.m.

318{
319 return @"PlayerShip";
320}

References oo_jsClassName.

Referenced by oo_jsClassName.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setJSSelf:context:

- (void) setJSSelf: (JSObject *) val
context: (JSContext *) context 

Extends class PlayerEntity.

Definition at line 323 of file OOJSPlayerShip.m.

323 :(JSObject *)val context:(JSContext *)context
324{
325 _jsSelf = val;
326 OOJSAddGCObjectRoot(context, &_jsSelf, "Player jsSelf");
327
328 [[NSNotificationCenter defaultCenter] addObserver:self
329 selector:@selector(javaScriptEngineWillReset:)
330 name:kOOJavaScriptEngineWillResetNotification
332}
#define OOJSAddGCObjectRoot(context, root, name)

References OOJSAddGCObjectRoot, and OOJavaScriptEngine::sharedEngine.

+ Here is the call graph for this function:

The documentation for this category was generated from the following files: