Oolite
Loading...
Searching...
No Matches
OOJSPlayerShip.h File Reference
import "PlayerEntity.h"
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 269 of file OOJSPlayerShip.m.

270{
274
275 PlayerEntity* player = [PlayerEntity sharedPlayer]; // NOTE: at time of writing, this creates the player entity. Don't use PLAYER here.
276
277 // Create ship object as a property of the player object.
279 JS_SetPrivate(context, sPlayerShipObject, OOConsumeReference([player weakRetain]));
280 [player setJSSelf:sPlayerShipObject context:context];
281 // Analyzer: object leaked. [Expected, object is retained by JS object.]
282}
id OOConsumeReference(id OO_NS_CONSUMED value)
static JSFunctionSpec sPlayerShipMethods[]
static JSClass sPlayerShipClass
static JSObject * sPlayerShipObject
static JSObject * sPlayerShipPrototype
static JSPropertySpec sPlayerShipProperties[]
JSObject * JSPlayerObject(void)
Definition OOJSPlayer.m:170
JSObject * JSShipPrototype(void)
Definition OOJSShip.m:587
JSClass * JSShipClass(void)
Definition OOJSShip.m:582
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.

Referenced by OOJavaScriptEngine(Private)::createMainThreadContext.

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

◆ JSPlayerShipClass()

JSClass * JSPlayerShipClass ( void )

Definition at line 284 of file OOJSPlayerShip.m.

285{
286 return &sPlayerShipClass;
287}

References sPlayerShipClass.

◆ JSPlayerShipObject()

JSObject * JSPlayerShipObject ( void )

Definition at line 294 of file OOJSPlayerShip.m.

295{
296 return sPlayerShipObject;
297}

References sPlayerShipObject.

Referenced by InitOOJSManifest(), and InitOOJSManifest().

Here is the caller graph for this function:

◆ JSPlayerShipPrototype()

JSObject * JSPlayerShipPrototype ( void )

Definition at line 289 of file OOJSPlayerShip.m.

290{
292}

References sPlayerShipPrototype.