Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
WormholeEntity.h
Go to the documentation of this file.
1/*
2
3WormholeEntity.h
4
5Entity subclass representing a wormhole between systems. (This is -- to use
6technical terminology -- the blue blobby thing you see hanging in space. The
7purple tunnel is RingEntity.)
8
9Oolite
10Copyright (C) 2004-2013 Giles C Williams and contributors
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25MA 02110-1301, USA.
26
27*/
28
29#import "Entity.h"
30
31#define WORMHOLE_EXPIRES_TIMEINTERVAL 900.0
32#define WORMHOLE_SHRINK_RATE 4000.0
33#define WORMHOLE_LEADER_SPEED_FACTOR 0.25
34
35@class ShipEntity, Universe;
36
46
48{
49@private
50 double expiry_time; // Time when wormhole entrance closes
51 double travel_time; // Time taken for a ship to traverse the wormhole
52 double arrival_time; // Time when wormhole exit opens
53 double estimated_arrival_time; // Time when wormhole should open (be different to arrival_time for misjump wormholes)
54 double scan_time; // Time when wormhole was scanned
55
58
59 NSPoint originCoords; // May not equal our origin system if the wormhole opens from Interstellar Space
60 NSPoint destinationCoords; // May not equal the destination system if the wormhole misjumps
61
62 NSMutableArray *shipsInTransit;
63
64 double witch_mass;
65 double shrink_factor; // used during nova mission
66// not used yet
67 double exit_speed; // exit speed of ships in this wormhole
68
74}
75
76- (WormholeEntity*) initWithDict:(NSDictionary*)dict;
77- (WormholeEntity*) initWormholeTo:(OOSystemID) s fromShip:(ShipEntity *) ship;
78
79- (BOOL) suckInShip:(ShipEntity *) ship;
80- (void) disgorgeShips;
81- (void) setExitPosition:(HPVector)pos;
82
84- (OOSystemID) destination;
85- (NSPoint) originCoordinates;
86- (NSPoint) destinationCoordinates;
87
88- (void) setMisjump; // Flags up a wormhole as 'misjumpy'
89- (void) setMisjumpWithRange:(GLfloat)range; // Flags up a wormhole as 'misjumpy'
90- (BOOL) withMisjump;
91- (GLfloat) misjumpRange;
92
93- (double) exitSpeed; // exit speed from this wormhole
94- (void) setExitSpeed:(double) speed; // set exit speed from this wormhole
95
96- (double) expiryTime; // Time at which the wormholes entrance closes
97- (double) arrivalTime; // Time at which the wormholes exit opens
98- (double) estimatedArrivalTime; // Time when wormhole should open (different from arrival_time for misjump wormholes)
99- (double) travelTime; // Time needed for a ship to traverse the wormhole
100- (double) scanTime; // Time when wormhole was scanned
101- (void) setScannedAt:(double)time;
102- (void) setContainsPlayer:(BOOL)val; // mark the wormhole as waiting for player exit
103
104- (BOOL) isScanned; // True if the wormhole has been scanned by the player
105- (WORMHOLE_SCANINFO) scanInfo; // Stage of scanning
106- (void)setScanInfo:(WORMHOLE_SCANINFO) scanInfo;
107
108- (NSArray*) shipsInTransit;
109
110- (NSString *) identFromShip:(ShipEntity*) ship;
111
112- (NSDictionary *)getDict;
113
114@end
int16_t OOSystemID
Definition OOTypes.h:211
WORMHOLE_SCANINFO
@ WH_SCANINFO_NONE
@ WH_SCANINFO_SCANNED
@ WH_SCANINFO_SHIP
@ WH_SCANINFO_ARRIVAL_TIME
@ WH_SCANINFO_DESTINATION
@ WH_SCANINFO_COLLAPSE_TIME
OOSystemID destination
NSPoint destinationCoords
WORMHOLE_SCANINFO scan_info
double estimated_arrival_time
NSMutableArray * shipsInTransit
GLfloat _misjumpRange
OOSystemID origin
voidpf uLong int origin
Definition ioapi.h:140