Oolite
Loading...
Searching...
No Matches
DockEntity.h
Go to the documentation of this file.
1/*
2
3DockEntity.h
4
5ShipEntity subclass representing a dock.
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#pragma once
28
29#import "ShipEntity.h"
30#import "StationEntity.h" // For MAX_DOCKING_STAGES
31
32@interface DockEntity : ShipEntity {
33@private
34 NSMutableDictionary* shipsOnApproach;
35 NSMutableArray* launchQueue;
37 // double approach_spacing; // not needed now holding pattern changed
38
39 ShipEntity* id_lock[MAX_DOCKING_STAGES]; // OOWeakReferences to a ShipEntity
40
42 double port_corridor; // corridor length inside station.
43
49}
50
51- (void)clear;
52
53// Docking
54- (BOOL)allowsDocking;
55- (void)setAllowsDocking:(BOOL)allow;
56- (BOOL)disallowedDockingCollides;
57- (void)setDisallowedDockingCollides:(BOOL)ddc;
58- (NSUInteger)countOfShipsInDockingQueue;
99- (NSDictionary*)dockingInstructionsForShip:(ShipEntity*)ship;
100- (NSString*)canAcceptShipForDocking:(ShipEntity*)ship;
101- (BOOL)shipIsInDockingCorridor:(ShipEntity*)ship;
102- (BOOL)shipIsInDockingQueue:(ShipEntity*)ship;
103- (void)abortDockingForShip:(ShipEntity*)ship;
104- (void)abortAllDockings;
105- (BOOL)dockingCorridorIsEmpty;
106- (void)clearDockingCorridor;
107- (void)autoDockShipsOnApproach;
108- (NSUInteger)pruneAndCountShipsOnApproach;
109- (void)noteDockingForShip:(ShipEntity*)ship;
110
111// Launching
112- (BOOL)allowsLaunching;
113- (void)setAllowsLaunching:(BOOL)allow;
114- (NSUInteger)countOfShipsInLaunchQueue;
115- (NSUInteger)countOfShipsInLaunchQueueWithPrimaryRole:(NSString*)role;
116- (BOOL)allowsLaunchingOf:(ShipEntity*)ship;
117- (void)launchShip:(ShipEntity*)ship;
118- (void)addShipToLaunchQueue:(ShipEntity*)ship withPriority:(BOOL)priority;
119
120// Geometry
121- (void)setDimensionsAndCorridor:(BOOL)docking ddc:(BOOL)ddc launching:(BOOL)launching;
122- (Vector)portUpVectorForShipsBoundingBox:(BoundingBox)bb;
123- (BOOL)isOffCentre;
124- (void)setVirtual;
125
126@end
double port_corridor
Definition DockEntity.h:42
NSMutableDictionary * shipsOnApproach
Definition DockEntity.h:34
BOOL virtual_dock
Definition DockEntity.h:48
Vector port_dimensions
Definition DockEntity.h:41
BOOL allow_docking
Definition DockEntity.h:46
BOOL allow_launching
Definition DockEntity.h:45
ShipEntity * id_lock[MAX_DOCKING_STAGES]
Definition DockEntity.h:39
double last_launch_time
Definition DockEntity.h:36
BOOL no_docking_while_launching
Definition DockEntity.h:44
BOOL disallowed_docking_collides
Definition DockEntity.h:47
NSMutableArray * launchQueue
Definition DockEntity.h:35