Oolite
Loading...
Searching...
No Matches
OOJSPlayerShip.h
Go to the documentation of this file.
1/*
2
3OOJSPlayerShip.h (QuickJS-ng)
4
5JavaScript proxy for the player's ship.
6While the player and player's ship are not differentiated in Oolite, such a
7separation makes more sense conceptually and design-wise, and we might want to
8make it that way in the future. The scripting interface anticipates this by
9using two separate objects for the player and player's ship.
10
11The -javaScriptValue of the PlayerEntity is the player's ship.
12
13
14Oolite
15Copyright (C) 2004-2013 Giles C Williams and contributors
16
17This program is free software; you can redistribute it and/or
18modify it under the terms of the GNU General Public License
19as published by the Free Software Foundation; either version 2
20of the License, or (at your option) any later version.
21
22This program is distributed in the hope that it will be useful,
23but WITHOUT ANY WARRANTY; without even the implied warranty of
24MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25GNU General Public License for more details.
26
27You should have received a copy of the GNU General Public License
28along with this program; if not, write to the Free Software
29Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
30MA 02110-1301, USA.
31
32*/
33
34#pragma once
35
36#import "PlayerEntity.h"
37#import <Foundation/Foundation.h>
38#include <quickjs.h>
39
40@class PlayerEntity;
41
42void InitOOJSPlayerShip(JSContext* context, JSValueConst global);
43
44JSClassID JSPlayerShipClassID(void);
45
46/* The player's ship object (player.ship), which is also the PlayerEntity's
47 -oo_jsValueInContext:. The returned value is owned by the caller, who must
48 JS_FreeValue() it. (SpiderMonkey's JSPlayerShipPrototype() is no longer
49 needed; use JS_GetClassProto(context, JSPlayerShipClassID()).)
50*/
51JSValue JSPlayerShipObject(void);
JSObject * JSPlayerShipObject(void)
void InitOOJSPlayerShip(JSContext *context, JSObject *global)
JSClassID JSPlayerShipClassID(void)