Oolite
Loading...
Searching...
No Matches
EntityOOJavaScriptExtensions.h
Go to the documentation of this file.
1/*
2
3EntityOOJavaScriptExtensions.h (QuickJS-ng)
4
5JavaScript support methods for entities.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24*/
25
26#pragma once
27
28#import "Entity.h"
30
31@interface Entity (OOJavaScriptExtensions)
32
34
35- (NSString*)oo_jsClassName;
36
37// Internal:
38// The JS class of the entity's wrapper object; subclasses override this.
39- (JSClassID)oo_jsClassID;
41
42@end
43
44@interface ShipEntity (OOJavaScriptExtensions)
45
46// "Normal" subentities, excluding flashers and exhaust plumes.
48
49- (void)setTargetForScript:(ShipEntity*)target;
50
51@end
52
53@interface PlayerEntity (OOJavaScriptExtensions)
54
55// The player's wrapper is created by OOJSPlayerShip; the entity keeps its own reference to val.
56- (void)setJSSelf:(JSValueConst)val context:(JSContext*)context;
57
58@end