Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOJSPlayerShip.h File Reference
import <Foundation/Foundation.h>
#include <jsapi.h>
+ Include dependency graph for OOJSPlayerShip.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void InitOOJSPlayerShip (JSContext *context, JSObject *global)
 
JSClass * JSPlayerShipClass (void)
 
JSObject * JSPlayerShipPrototype (void)
 
JSObject * JSPlayerShipObject (void)
 

Function Documentation

◆ InitOOJSPlayerShip()

void InitOOJSPlayerShip ( JSContext * context,
JSObject * global )

Definition at line 281 of file OOJSPlayerShip.m.

282{
286
287 PlayerEntity *player = [PlayerEntity sharedPlayer]; // NOTE: at time of writing, this creates the player entity. Don't use PLAYER here.
288
289 // Create ship object as a property of the player object.
291 JS_SetPrivate(context, sPlayerShipObject, OOConsumeReference([player weakRetain]));
292 [player setJSSelf:sPlayerShipObject context:context];
293 // Analyzer: object leaked. [Expected, object is retained by JS object.]
294}
id OOConsumeReference(id OO_NS_CONSUMED value)
Definition OOCocoa.m:93
static JSFunctionSpec sPlayerShipMethods[]
static JSClass sPlayerShipClass
static JSObject * sPlayerShipObject
static JSObject * sPlayerShipPrototype
static JSPropertySpec sPlayerShipProperties[]
JSObject * JSPlayerObject(void)
Definition OOJSPlayer.m:185
JSObject * JSShipPrototype(void)
Definition OOJSShip.m:601
JSClass * JSShipClass(void)
Definition OOJSShip.m:595
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
#define OOJS_PROP_READONLY
void OOJSRegisterSubclass(JSClass *subclass, JSClass *superclass)
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)

References JSPlayerObject(), JSShipClass(), JSShipPrototype(), OOConsumeReference(), OOJS_PROP_READONLY, OOJSBasicPrivateObjectConverter(), OOJSRegisterObjectConverter(), OOJSRegisterSubclass(), OOJSUnconstructableConstruct(), PlayerEntity::setJSSelf:context:, PlayerEntity::sharedPlayer, sPlayerShipClass, sPlayerShipMethods, sPlayerShipObject, sPlayerShipProperties, and sPlayerShipPrototype.

+ Here is the call graph for this function:

◆ JSPlayerShipClass()

JSClass * JSPlayerShipClass ( void )

Definition at line 297 of file OOJSPlayerShip.m.

298{
299 return &sPlayerShipClass;
300}

References sPlayerShipClass.

◆ JSPlayerShipObject()

JSObject * JSPlayerShipObject ( void )

Definition at line 309 of file OOJSPlayerShip.m.

310{
311 return sPlayerShipObject;
312}

References sPlayerShipObject.

Referenced by InitOOJSManifest().

+ Here is the caller graph for this function:

◆ JSPlayerShipPrototype()

JSObject * JSPlayerShipPrototype ( void )

Definition at line 303 of file OOJSPlayerShip.m.

304{
306}

References sPlayerShipPrototype.