Oolite
Loading...
Searching...
No Matches
PlayerEntity(OOJavaScriptExtensions) Category Reference

#include <EntityOOJavaScriptExtensions.h>

Instance Methods

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

Detailed Description

Definition at line 53 of file EntityOOJavaScriptExtensions.h.

Method Documentation

◆ javaScriptEngineWillReset:

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

Extends class PlayerEntity.

Definition at line 317 of file OOJSPlayerShip.m.

317 :(NSNotification*)notification
318{
319 [[NSNotificationCenter defaultCenter] removeObserver:self
320 name:kOOJavaScriptEngineWillResetNotification
322
323 if (_jsSelf != NULL) {
324
325 JSContext* context = OOJSAcquireContext();
326 JS_RemoveObjectRoot(context, &_jsSelf);
327 _jsSelf = NULL;
328 OOJSRelinquishContext(context);
329 }
330}
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_jsClassID

- (JSClassID) oo_jsClassID
implementation

Extends class PlayerEntity.

Definition at line 308 of file OOJSPlayerShip.m.

309{
310 return sPlayerShipClassID;
311}
static JSClassID sPlayerShipClassID

References oo_jsClassID, and sPlayerShipClassID.

Referenced by oo_jsClassID.

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

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Extends class PlayerEntity.

Definition at line 301 of file OOJSPlayerShip.m.

302{
303 return @"PlayerShip";
304}

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: [1/2]

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

Extends class PlayerEntity.

Definition at line 313 of file OOJSPlayerShip.m.

313 :(JSValueConst)val context:(JSContext*)context
314{
315 // Drop any previous wrapper (and its reset observer).
316 [self deleteJSSelf];
317
318 // Released by -deleteJSSelf when the JavaScript engine resets.
319 _jsSelf = JS_DupValue(context, val);
320
321 [[NSNotificationCenter defaultCenter] addObserver:self
322 selector:@selector(deleteJSSelf)
323 name:kOOJavaScriptEngineWillResetNotification
325}

References Entity::deleteJSSelf, and OOJavaScriptEngine::sharedEngine.

Here is the call graph for this function:

◆ setJSSelf:context: [2/2]

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

Extends class PlayerEntity.

Definition at line 313 of file OOJSPlayerShip.m.

313 :(JSValueConst)val context:(JSContext*)context
314{
315 // Drop any previous wrapper (and its reset observer).
316 [self deleteJSSelf];
317
318 // Released by -deleteJSSelf when the JavaScript engine resets.
319 _jsSelf = JS_DupValue(context, val);
320
321 [[NSNotificationCenter defaultCenter] addObserver:self
322 selector:@selector(deleteJSSelf)
323 name:kOOJavaScriptEngineWillResetNotification
325}

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