Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
ShipEntity(OOJavaScriptExtensions) Category Reference

#include <EntityOOJavaScriptExtensions.h>

Instance Methods

(NSArray *) - subEntitiesForScript
 
(void) - setTargetForScript:
 
(BOOL) - isVisibleToScripts [implementation]
 
(void) - getJSClass:andPrototype: [implementation]
 
(NSString *) - oo_jsClassName [implementation]
 

Detailed Description

Definition at line 45 of file EntityOOJavaScriptExtensions.h.

Method Documentation

◆ getJSClass:andPrototype:

- (void) getJSClass: (JSClass **) outClass
andPrototype: (JSObject **) outPrototype 
implementation

Extends class ShipEntity.

Definition at line 1 of file EntityOOJavaScriptExtensions.m.

121 :(JSClass **)outClass andPrototype:(JSObject **)outPrototype
122{
123 *outClass = JSShipClass();
124 *outPrototype = JSShipPrototype();
125}
JSObject * JSShipPrototype(void)
Definition OOJSShip.m:601
JSClass * JSShipClass(void)
Definition OOJSShip.m:595

◆ isVisibleToScripts

- (BOOL) isVisibleToScripts
implementation

Extends class ShipEntity.

Definition at line 1 of file EntityOOJavaScriptExtensions.m.

116{
117 return YES;
118}

◆ oo_jsClassName

- (NSString *) oo_jsClassName
implementation

Extends class ShipEntity.

Definition at line 1 of file EntityOOJavaScriptExtensions.m.

129{
130 return @"Ship";
131}

◆ setTargetForScript:

- (void) setTargetForScript: (ShipEntity *) target

Extends class ShipEntity.

Definition at line 1 of file EntityOOJavaScriptExtensions.m.

140 :(ShipEntity *)target
141{
142 ShipEntity *me = self;
143
144 // Ensure coherence by not fiddling with subentities.
145 while ([me isSubEntity])
146 {
147 if (me == [me owner] || [me owner] == nil) break;
148 me = (ShipEntity *)[me owner];
149 }
150 while ([target isSubEntity])
151 {
152 if (target == [target owner] || [target owner] == nil) break;
153 target = (ShipEntity *)[target owner];
154 }
155 if (![me isKindOfClass:[ShipEntity class]]) return;
156 if (target != nil)
157 {
158 [me addTarget:target];
159 }
160 else [me removeTarget:[me primaryTarget]];
161}
return nil
void addTarget:(Entity *targetEntity)
void removeTarget:(Entity *targetEntity)

◆ subEntitiesForScript

- (NSArray *) subEntitiesForScript

Extends class ShipEntity.

Definition at line 1 of file EntityOOJavaScriptExtensions.m.

135{
136 return [[self shipSubEntityEnumerator] allObjects];
137}

The documentation for this category was generated from the following files: