Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
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 1860 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 kOOMaximumSystemID, nil, OOJS_ARGV, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, OOJSReportBadArguments(), and PLAYER.

+ Here is the call graph for this function:

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Extends class PlayerEntity.

Definition at line 1860 of file OOJSPlayerShip.m.

318{
319 return @"PlayerShip";
320}

◆ setJSSelf:context:

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

Extends class PlayerEntity.

Definition at line 1860 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)

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