Oolite
Loading...
Searching...
No Matches
OOJSPlayer.h File Reference
import "PlayerEntity.h"
import <Foundation/Foundation.h>
#include <jsapi.h>
Include dependency graph for OOJSPlayer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void InitOOJSPlayer (JSContext *context, JSObject *global)
JSClass * JSPlayerClass (void)
JSObject * JSPlayerPrototype (void)
JSObject * JSPlayerObject (void)
PlayerEntity * OOPlayerForScripting (void)

Function Documentation

◆ InitOOJSPlayer()

void InitOOJSPlayer ( JSContext * context,
JSObject * global )

Definition at line 151 of file OOJSPlayer.m.

152{
153 sPlayerPrototype = JS_InitClass(context, global, NULL, &sPlayerClass, OOJSUnconstructableConstruct, 0, sPlayerProperties, sPlayerMethods, NULL, NULL);
155
156 // Create player object as a property of the global object.
157 sPlayerObject = JS_DefineObject(context, global, "player", &sPlayerClass, sPlayerPrototype, OOJS_PROP_READONLY);
158}
static JSClass sPlayerClass
Definition OOJSPlayer.m:63
static JSObject * sPlayerPrototype
Definition OOJSPlayer.m:41
static JSObject * sPlayerObject
Definition OOJSPlayer.m:42
static JSPropertySpec sPlayerProperties[]
Definition OOJSPlayer.m:104
static JSFunctionSpec sPlayerMethods[]
Definition OOJSPlayer.m:131
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
#define OOJS_PROP_READONLY
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)

References OOJS_PROP_READONLY, OOJSBasicPrivateObjectConverter(), OOJSRegisterObjectConverter(), OOJSUnconstructableConstruct(), sPlayerClass, sPlayerMethods, sPlayerObject, sPlayerProperties, and sPlayerPrototype.

Referenced by OOJavaScriptEngine(Private)::createMainThreadContext.

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

◆ JSPlayerClass()

JSClass * JSPlayerClass ( void )

Definition at line 160 of file OOJSPlayer.m.

161{
162 return &sPlayerClass;
163}

References sPlayerClass.

◆ JSPlayerObject()

JSObject * JSPlayerObject ( void )

Definition at line 170 of file OOJSPlayer.m.

171{
172 return sPlayerObject;
173}

References sPlayerObject.

Referenced by InitOOJSPlayerShip(), and JSPlayerShipObject().

Here is the caller graph for this function:

◆ JSPlayerPrototype()

JSObject * JSPlayerPrototype ( void )

Definition at line 165 of file OOJSPlayer.m.

166{
167 return sPlayerPrototype;
168}

References sPlayerPrototype.

◆ OOPlayerForScripting()

PlayerEntity * OOPlayerForScripting ( void )

Definition at line 175 of file OOJSPlayer.m.

176{
177 PlayerEntity* player = PLAYER;
178 [player setScriptTarget:player];
179
180 return player;
181}
#define PLAYER

References PLAYER, and PlayerEntity::setScriptTarget:.

Referenced by ClockGetProperty(), ClockGetProperty(), EquipmentInfoGetProperty(), EquipmentInfoGetProperty(), GlobalClearExtraGuiScreenKeys(), GlobalClearExtraGuiScreenKeys(), GlobalGetProperty(), GlobalGetProperty(), GlobalKeyBindingDescription(), GlobalKeyBindingDescription(), GlobalSetExtraGuiScreenKeys(), GlobalSetExtraGuiScreenKeys(), JSClockToString(), JSClockToString(), ManifestGetOwnProperty(), ManifestGetProperty(), ManifestGetProperty(), ManifestSetProperty(), ManifestSetProperty(), MissionAddMessageText(), MissionAddMessageText(), MissionGetProperty(), MissionGetProperty(), MissionMarkSystem(), MissionMarkSystem(), MissionRunCallback(), MissionRunCallback(), MissionRunScreen(), MissionRunScreen(), MissionRunShipLibrary(), MissionRunShipLibrary(), MissionSetInstructionsInternal(), MissionSetInstructionsInternal(), MissionSetProperty(), MissionSetProperty(), MissionUnmarkSystem(), MissionUnmarkSystem(), MissionVariablesDeleteProperty(), MissionVariablesDeleteProperty(), MissionVariablesGetProperty(), MissionVariablesSetProperty(), PlayerShipAddParcel(), PlayerShipAddParcel(), PlayerShipAddPassenger(), PlayerShipAddPassenger(), PlayerShipAwardContract(), PlayerShipAwardContract(), PlayerShipAwardEquipmentToCurrentPylon(), PlayerShipAwardEquipmentToCurrentPylon(), PlayerShipBeginGalacticHyperspaceCountdown(), PlayerShipBeginGalacticHyperspaceCountdown(), PlayerShipBeginHyperspaceCountdown(), PlayerShipBeginHyperspaceCountdown(), PlayerShipCancelDockingRequest(), PlayerShipCancelDockingRequest(), PlayerShipCancelHyperspaceCountdown(), PlayerShipCancelHyperspaceCountdown(), PlayerShipEngageAutopilotToStation(), PlayerShipEngageAutopilotToStation(), PlayerShipGetProperty(), PlayerShipGetProperty(), PlayerShipHideHUDSelector(), PlayerShipHideHUDSelector(), PlayerShipRemoveAllCargo(), PlayerShipRemoveAllCargo(), PlayerShipRemoveContract(), PlayerShipRemoveContract(), PlayerShipRemoveParcel(), PlayerShipRemoveParcel(), PlayerShipRemovePassenger(), PlayerShipRemovePassenger(), PlayerShipRequestDockingClearance(), PlayerShipRequestDockingClearance(), PlayerShipResetCustomView(), PlayerShipResetCustomView(), PlayerShipResetScannerZoom(), PlayerShipResetScannerZoom(), PlayerShipSetCustomHUDDial(), PlayerShipSetCustomHUDDial(), PlayerShipSetCustomView(), PlayerShipSetCustomView(), PlayerShipSetMultiFunctionDisplay(), PlayerShipSetMultiFunctionDisplay(), PlayerShipSetMultiFunctionText(), PlayerShipSetMultiFunctionText(), PlayerShipSetPrimedEquipment(), PlayerShipSetPrimedEquipment(), PlayerShipSetProperty(), PlayerShipSetProperty(), PlayerShipShowHUDSelector(), PlayerShipShowHUDSelector(), PlayerShipTakeInternalDamage(), PlayerShipTakeInternalDamage(), PlayerShipUseSpecialCargo(), PlayerShipUseSpecialCargo(), SetMissionVariable(), ShipRunLegacyScriptActions(), ShipRunLegacyScriptActions(), StationDockPlayer(), StationDockPlayer(), SystemAddMoon(), SystemAddMoon(), SystemAddPlanet(), SystemAddPlanet(), SystemGetProperty(), SystemGetProperty(), SystemLegacyAddShipsAt(), SystemLegacyAddShipsAt(), SystemLegacyAddShipsAtPrecisely(), SystemLegacyAddShipsAtPrecisely(), SystemLegacyAddShipsWithinRadius(), SystemLegacyAddShipsWithinRadius(), SystemLegacySpawnShip(), SystemLegacySpawnShip(), SystemSendAllShipsAway(), SystemSendAllShipsAway(), SystemSetProperty(), SystemSetProperty(), SystemToString(), SystemToString(), ValueForMissionVariable(), WorldScriptsGetOwnProperty(), and WorldScriptsGetProperty().

Here is the call graph for this function: