Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
StationEntity.h
Go to the documentation of this file.
1/*
2
3StationEntity.h
4
5ShipEntity subclass representing a space station or dockable ship.
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
27#import "ShipEntity.h"
29#import "Universe.h"
30
31@class OOWeakSet;
32
33
40
41#define STATION_MAX_POLICE 8
42
43#define STATION_DELAY_BETWEEN_LAUNCHES 6.0
44
45#define STATION_LAUNCH_RETRY_INTERVAL 2.0
46
47#define MAX_DOCKING_STAGES 16
48
49#define DOCKING_CLEARANCE_WINDOW 126.0
50
51
53{
54@private
60
61 unsigned max_police; // max no. of police ships allowed
62 unsigned max_defense_ships; // max no. of defense ships allowed
64
65 unsigned max_scavengers; // max no. of scavenger ships allowed
67
70
73
77
79
80 NSString *allegiance;
81
86// NSMutableArray *localPassengers;
87// NSMutableArray *localContracts;
88 NSMutableArray *localShipyard;
89
90 NSMutableDictionary *localInterfaces;
91
95
99
102
112}
113
114
115- (OOCargoQuantity) marketCapacity;
116- (NSArray *) marketDefinition;
117- (NSString *) marketScriptName;
118- (BOOL) marketMonitored;
119- (BOOL) marketBroadcast;
120- (OOCreditsQuantity) legalStatusOfManifest:(OOCommodityMarket *)manifest export:(BOOL)export;
121
122- (OOCommodityMarket *) localMarket;
123- (void) setLocalMarket:(NSArray *)market;
124- (NSDictionary *) localMarketForScripting;
125- (void) setPrice:(OOCreditsQuantity) price forCommodity:(OOCommodityType) commodity;
126- (void) setQuantity:(OOCargoQuantity) quantity forCommodity:(OOCommodityType) commodity;
127
128/*- (NSMutableArray *) localPassengers;
129- (void) setLocalPassengers:(NSArray *)market;
130- (NSMutableArray *) localContracts;
131- (void) setLocalContracts:(NSArray *)market; */
132- (NSMutableArray *) localShipyard;
133- (void) setLocalShipyard:(NSArray *)market;
134- (void) generateShipyard;
135- (void) generateShipyard:(OOTechLevelID)stationTechLevel;
136- (NSMutableDictionary *) localInterfaces;
137- (void) setInterfaceDefinition:(OOJSInterfaceDefinition *)definition forKey:(NSString *)key;
138
139- (OOCommodityMarket *) initialiseLocalMarket;
140
141- (OOTechLevelID) equivalentTechLevel;
142- (void) setEquivalentTechLevel:(OOTechLevelID)value;
143
144- (NSEnumerator *) dockSubEntityEnumerator;
145- (Vector) virtualPortDimensions;
146- (DockEntity*) playerReservedDock;
147
148- (HPVector) beaconPosition;
149
150- (float) equipmentPriceFactor;
151
152- (void) setPlanet:(OOPlanetEntity *)planet;
153
154- (OOPlanetEntity *) planet;
155
156- (void) setAllegiance:(NSString *)newAllegiance;
157- (NSString *)allegiance;
158
159- (unsigned) countOfDockedContractors;
160- (unsigned) countOfDockedPolice;
161- (unsigned) countOfDockedDefenders;
162
163- (void) sanityCheckShipsOnApproach;
164
165- (void) autoDockShipsOnApproach;
166
167- (Vector) portUpVectorForShip:(ShipEntity *)ship;
168
169- (NSDictionary *) dockingInstructionsForShip:(ShipEntity *)ship;
170
171- (BOOL) shipIsInDockingCorridor:(ShipEntity *)ship;
172
173- (BOOL) dockingCorridorIsEmpty;
174
175- (void) clearDockingCorridor;
176
177- (void) clear;
178
179
180- (void) abortAllDockings;
181
182- (void) abortDockingForShip:(ShipEntity *)ship;
183
184- (BOOL) hasMultipleDocks;
185- (BOOL) hasClearDock;
186- (BOOL) hasLaunchDock;
187- (DockEntity *) selectDockForDocking;
188- (unsigned) currentlyInLaunchingQueues;
189- (unsigned) currentlyInDockingQueues;
190
191
192- (void) launchShip:(ShipEntity *)ship;
193
194- (ShipEntity *) launchIndependentShip:(NSString *)role;
195
196- (void) noteDockedShip:(ShipEntity *)ship;
197
198- (BOOL) interstellarUndockingAllowed;
199- (BOOL) hasNPCTraffic;
200- (void) setHasNPCTraffic:(BOOL)flag;
201
202- (OOStationAlertLevel) alertLevel;
203- (void) setAlertLevel:(OOStationAlertLevel)level signallingScript:(BOOL)signallingScript;
204
206
207- (void) increaseAlertLevel;
208- (void) decreaseAlertLevel;
209
210- (NSArray *) launchPolice;
211- (ShipEntity *) launchDefenseShip;
212- (ShipEntity *) launchScavenger;
213- (ShipEntity *) launchMiner;
215- (ShipEntity *) launchPirateShip;
216- (ShipEntity *) launchShuttle;
217- (ShipEntity *) launchEscort;
218- (ShipEntity *) launchPatrol;
219
220- (void) launchShipWithRole:(NSString *)role;
221
222- (void) acceptPatrolReportFrom:(ShipEntity *)patrol_ship;
223
224- (NSString *) acceptDockingClearanceRequestFrom:(ShipEntity *)other;
225- (BOOL) requiresDockingClearance;
226- (void) setRequiresDockingClearance:(BOOL)newValue;
227
228- (BOOL) allowsFastDocking;
229- (void) setAllowsFastDocking:(BOOL)newValue;
230
231- (BOOL) allowsAutoDocking;
232- (void) setAllowsAutoDocking:(BOOL)newValue;
233
234- (BOOL) allowsSaving;
235// no setting this after station creation
236
237- (NSString *) marketOverrideName;
238- (BOOL) isRotatingStation;
239- (BOOL) hasShipyard;
240
241- (BOOL) suppressArrivalReports;
242- (void) setSuppressArrivalReports:(BOOL)newValue;
243
244- (BOOL) hasBreakPattern;
245- (void) setHasBreakPattern:(BOOL)newValue;
246
247- (BOOL) fitsInDock:(ShipEntity *)ship;
248- (BOOL) fitsInDock:(ShipEntity *)ship andLogNoFit:(BOOL)logNoFit;
249
250@end
251
252
253
254NSDictionary *OOMakeDockingInstructions(StationEntity *station, HPVector coords, float speed, float range, NSString *ai_message, NSString *comms_message, BOOL match_rotation, int docking_stage);
NSString * OOCommodityType
Definition OOTypes.h:106
uint64_t OOCreditsQuantity
Definition OOTypes.h:182
uint16_t OOUniversalID
Definition OOTypes.h:189
NSUInteger OOTechLevelID
Definition OOTypes.h:204
uint32_t OOCargoQuantity
Definition OOTypes.h:176
@ ALERT_CONDITION_GREEN
Definition ShipEntity.h:176
@ ALERT_CONDITION_RED
Definition ShipEntity.h:178
@ ALERT_CONDITION_YELLOW
Definition ShipEntity.h:177
NSDictionary * OOMakeDockingInstructions(StationEntity *station, HPVector coords, float speed, float range, NSString *ai_message, NSString *comms_message, BOOL match_rotation, int docking_stage)
OOStationAlertLevel
@ STATION_ALERT_LEVEL_RED
@ STATION_ALERT_LEVEL_YELLOW
@ STATION_ALERT_LEVEL_GREEN
Vector port_dimensions
double last_launch_time
OOCommodityMarket * localMarket
double patrol_launch_interval
double last_trader_launch_time
NSMutableDictionary * localInterfaces
DockEntity * player_reserved_dock
NSMutableArray * localShipyard
unsigned allowsAutoDocking
unsigned defenders_launched
unsigned marketMonitored
OOUniversalID planet
unsigned max_police
unsigned no_docking_while_launching
OOCargoQuantity marketCapacity
OOTechLevelID equivalentTechLevel
unsigned allowsSaving
unsigned max_scavengers
OOStationAlertLevel alertLevel
unsigned marketBroadcast
unsigned hasBreakPattern
double last_shuttle_launch_time
unsigned interstellarUndockingAllowed
NSString * allegiance
unsigned scavengers_launched
unsigned docked_traders
OOWeakSet * _shipsOnHold
unsigned suppress_arrival_reports
unsigned allowsFastDocking
double shuttle_launch_interval
unsigned hasNPCTraffic
unsigned docked_shuttles
unsigned max_defense_ships
NSArray * marketDefinition
double approach_spacing
float equipmentPriceFactor
double last_patrol_report_time
NSString * marketScriptName
unsigned requiresDockingClearance
double trader_launch_interval