Oolite 1.91.0.7647-241230-5e1c242
|
#include <DockEntity.h>
Private Attributes | |
NSMutableDictionary * | shipsOnApproach |
NSMutableArray * | launchQueue |
double | last_launch_time |
ShipEntity * | id_lock [MAX_DOCKING_STAGES] |
Vector | port_dimensions |
double | port_corridor |
BOOL | no_docking_while_launching |
BOOL | allow_launching |
BOOL | allow_docking |
BOOL | disallowed_docking_collides |
BOOL | virtual_dock |
Definition at line 31 of file DockEntity.h.
- (void) abortAllDockings |
Definition at line 96 of file DockEntity.m.
References abortAllDockings, Entity::absolutePositionForSubentity, clearAllIdLocks, DOCKING_CLEARANCE_STATUS_REQUESTED, ShipEntity::doScriptEvent:, PlayerEntity::getTargetDockStation, Entity::isShip, last_launch_time, nil, no_docking_while_launching, Entity::parentEntity, PLAYER, Entity::position, ShipEntity::sendAIMessage:, ShipEntity::sendExpandedMessage:toShip:, PlayerEntity::setDockingClearanceStatus:, shipsOnApproach, and Entity::status.
Referenced by abortAllDockings, StationEntity::abortAllDockings, and setAllowsDocking:.
|
implementation |
Definition at line 143 of file DockEntity.m.
References abortAllLaunches, and no_docking_while_launching.
Referenced by abortAllLaunches, and setAllowsLaunching:.
- (void) abortDockingForShip: | (ShipEntity *) | ship |
Definition at line 589 of file DockEntity.m.
References Entity::absolutePositionForSubentity, clearIdLocks:, DOCKING_CLEARANCE_STATUS_REQUESTED, Entity::isPlayer, Entity::parentEntity, PLAYER, Entity::position, ShipEntity::sendExpandedMessage:toShip:, PlayerEntity::setDockingClearanceStatus:, shipsOnApproach, Entity::status, and Entity::universalID.
Referenced by StationEntity::abortDockingForShip:, and noteDockingForShip:.
- (void) addShipToLaunchQueue: | (ShipEntity *) | ship | |
withPriority: | (BOOL) | priority |
Definition at line 865 of file DockEntity.m.
References launchQueue, nil, pruneAndCountShipsOnApproach, and ShipEntity::setStatus:.
Referenced by StationEntity(OOPrivate)::addShipToLaunchQueue:withPriority:.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 445 of file DockEntity.m.
References Entity::absolutePositionForSubentity, ShipEntity::entityPersonalityInt, HPvector_forward_from_quaternion(), M_PI, MAX, ONE_EIGHTH, Entity::position, quaternion_multiply(), ShipEntity::sendExpandedMessage:toShip:, Entity::universalID, and UNIVERSE.
Referenced by dockingInstructionsForShip:.
- (BOOL) allowsDocking |
Definition at line 172 of file DockEntity.m.
References allow_docking, and allowsDocking.
Referenced by allowsDocking.
- (BOOL) allowsLaunching |
Definition at line 194 of file DockEntity.m.
References allow_launching, and allowsLaunching.
Referenced by allowsLaunching.
- (BOOL) allowsLaunchingOf: | (ShipEntity *) | ship |
Definition at line 952 of file DockEntity.m.
References OOJSScript::callMethod:inContext:withArguments:count:result:, Entity::isPlayer, Entity::isShip, OOJSAcquireContext(), OOJSRelinquishContext(), OOJSValueFromNativeObject(), port_dimensions, ShipEntity::script, and ShipEntity::totalBoundingBox.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 150 of file DockEntity.m.
References nil, and pullInShipIfPermitted:.
Referenced by autoDockShipsOnApproach.
- (void) autoDockShipsOnApproach |
Definition at line 166 of file DockEntity.m.
References autoDockShipsInQueue:, and autoDockShipsOnApproach.
Referenced by autoDockShipsOnApproach, and StationEntity::autoDockShipsOnApproach.
- (NSString *) canAcceptShipForDocking: | (ShipEntity *) | ship |
Definition at line 222 of file DockEntity.m.
References allow_docking, allow_launching, OOJSScript::callMethod:inContext:withArguments:count:result:, count, launchQueue, no_docking_while_launching, OOJSAcquireContext(), OOJSRelinquishContext(), OOJSValueFromNativeObject(), port_dimensions, ShipEntity::script, and ShipEntity::totalBoundingBox.
Referenced by StationEntity::acceptDockingClearanceRequestFrom:, and StationEntity::dockingInstructionsForShip:.
- (void) clear |
Definition at line 982 of file DockEntity.m.
References clear.
Referenced by clear, and StationEntity::clear.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 1221 of file DockEntity.m.
References DockEntity(OOPrivate)::clearAllIdLocks, DESTROY, and MAX_DOCKING_STAGES.
Referenced by abortAllDockings, and DockEntity(OOPrivate)::clearAllIdLocks.
- (void) clearDockingCorridor |
Definition at line 1064 of file DockEntity.m.
References Entity::absolutePositionForSubentity, clearDockingCorridor, HPvector_forward_from_quaternion(), Entity::isShip, Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), Entity::setPosition:, Entity::status, UNIVERSE, ShipEntity::update:, and vector_forward_from_quaternion().
Referenced by clearDockingCorridor, and StationEntity::clearDockingCorridor.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 1208 of file DockEntity.m.
References DESTROY, MAX_DOCKING_STAGES, and nil.
Referenced by abortDockingForShip:, dealloc, and dockingInstructionsForShip:.
- (NSUInteger) countOfShipsInDockingQueue |
Definition at line 660 of file DockEntity.m.
References countOfShipsInDockingQueue.
Referenced by countOfShipsInDockingQueue, StationEntity::currentlyInDockingQueues, and StationEntity::dockingInstructionsForShip:.
- (NSUInteger) countOfShipsInLaunchQueue |
Definition at line 666 of file DockEntity.m.
References countOfShipsInLaunchQueue.
Referenced by countOfShipsInLaunchQueue, and StationEntity::currentlyInLaunchingQueues.
- (NSUInteger) countOfShipsInLaunchQueueWithPrimaryRole: | (NSString *) | role |
Definition at line 940 of file DockEntity.m.
References count, launchQueue, and nil.
Referenced by StationEntity(OOPrivate)::countOfShipsInLaunchQueueWithPrimaryRole:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1198 of file DockEntity.m.
References clearIdLocks:, dealloc, ShipEntity::dealloc, DESTROY, launchQueue, and shipsOnApproach.
Referenced by dealloc.
- (BOOL) disallowedDockingCollides |
Definition at line 188 of file DockEntity.m.
References disallowed_docking_collides, and disallowedDockingCollides.
Referenced by disallowedDockingCollides.
- (BOOL) dockingCorridorIsEmpty |
Definition at line 989 of file DockEntity.m.
References Entity::absolutePositionForSubentity, dockingCorridorIsEmpty, HPvector_forward_from_quaternion(), Entity::isPlayer, Entity::isShip, last_launch_time, Entity::mass, Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), STATION_ALERT_LEVEL_RED, STATION_DELAY_BETWEEN_LAUNCHES, STATION_LAUNCH_RETRY_INTERVAL, Entity::status, and UNIVERSE.
Referenced by dockingCorridorIsEmpty, and update:.
- (NSDictionary *) dockingInstructionsForShip: | (ShipEntity *) | ship |
Guides a ship into the dock.
Now the ship is in the vicinity of the station in the correct hemispere. Let's guide them in.
TODO: Where is the detection that the ship has docked?
TODO: What are the magic number's units? Is it km (kilometers)?
Definition at line 282 of file DockEntity.m.
References Entity::absolutePositionForSubentity, addShipToShipsOnApproach:, clearIdLocks:, Entity::collision_radius, Entity::collisionRadius, count, ShipEntity::getAI, HPvector_forward_from_quaternion(), id_lock, ShipEntity::maxFlightSpeed, AI::message:, nil, OOLogERR, OOMakeDockingInstructions(), Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), SCANNER_MAX_RANGE, ShipEntity::sendExpandedMessage:toShip:, shipsOnApproach, Entity::universalID, and OOWeakRefObject::weakRetain.
Referenced by StationEntity::dockingInstructionsForShip:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1290 of file DockEntity.m.
References ShipEntity::drawImmediate:translucent:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Provided by category DockEntity(OOJavaScriptExtensions).
Definition at line 148 of file OOJSDock.m.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1177 of file DockEntity.m.
References allow_docking, allow_launching, disallowed_docking_collides, ShipEntity::initWithKey:definition:, launchQueue, nil, OOJS_PROFILE_ENTER, OOJS_PROFILE_EXIT, shipsOnApproach, and virtual_dock.
|
implementation |
Reimplemented from Entity.
Definition at line 1171 of file DockEntity.m.
References isDock.
Referenced by isDock.
- (BOOL) isOffCentre |
Definition at line 267 of file DockEntity.m.
References isOffCentre, Entity::orientation, Entity::position, and vector_forward_from_quaternion().
Referenced by isOffCentre.
- (void) launchShip: | (ShipEntity *) | ship |
Definition at line 888 of file DockEntity.m.
References Entity::absolutePositionForSubentity, Entity::boundingBox, ShipEntity::doScriptEvent:withArgument:, ShipEntity::doScriptEvent:withArgument:andReactToAIMessage:, ShipEntity::flightRoll, ShipEntity::flightSpeed, ShipEntity::getAI, ShipEntity::hasEscorts, Entity::isShip, last_launch_time, M_PI, ShipEntity::maxFlightSpeed, no_docking_while_launching, Entity::orientation, Entity::parentEntity, ShipEntity::pendingEscortCount, port_corridor, port_dimensions, quaternion_multiply(), quaternion_rotate_about_axis(), ShipEntity::resetExhaustPlumes, ShipEntity::setDesiredSpeed:, ShipEntity::setLaunchDelay:, AI::setNextThinkTime:, Entity::setNormalOrientation:, ShipEntity::setPendingEscortCount:, ShipEntity::setPitch:, Entity::setPosition:, ShipEntity::setRoll:, ShipEntity::setSpeed:, ShipEntity::setStatus:, Entity::setVelocity:, ShipEntity::setYaw:, vector_forward_from_quaternion(), and ShipEntity::velocity.
Referenced by StationEntity::launchShip:, and update:.
- (void) noteDockingForShip: | (ShipEntity *) | ship |
Definition at line 579 of file DockEntity.m.
References abortDockingForShip:, and last_launch_time.
Referenced by StationEntity::noteDockedShip:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1269 of file DockEntity.m.
References ShipEntity::noteTakingDamage:from:type:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Provided by category DockEntity(OOJavaScriptExtensions).
Definition at line 155 of file OOJSDock.m.
- (Vector) portUpVectorForShipsBoundingBox: | (BoundingBox) | bb |
Definition at line 624 of file DockEntity.m.
References Entity::orientation, Entity::parentEntity, port_dimensions, quaternion_multiply(), vector_right_from_quaternion(), and vector_up_from_quaternion().
Referenced by StationEntity::portUpVectorForShip:.
- (NSUInteger) pruneAndCountShipsOnApproach |
Definition at line 62 of file DockEntity.m.
References Entity::absolutePositionForSubentity, count, ShipEntity::doScriptEvent:, last_launch_time, nil, Entity::position, pruneAndCountShipsOnApproach, SCANNER_MAX_RANGE2, ShipEntity::sendAIMessage:, shipsOnApproach, and UNIVERSE.
Referenced by addShipToLaunchQueue:withPriority:, pruneAndCountShipsOnApproach, and StationEntity::sanityCheckShipsOnApproach.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 854 of file DockEntity.m.
References ShipEntity::enterDock:, and Entity::parentEntity.
Referenced by DockEntity(OOPrivate)::autoDockShipsInQueue:, and shipIsInDockingCorridor:.
- (void) setAllowsDocking: | (BOOL) | allow |
Definition at line 178 of file DockEntity.m.
References abortAllDockings, and allow_docking.
Referenced by DockSetProperty().
- (void) setAllowsLaunching: | (BOOL) | allow |
Definition at line 200 of file DockEntity.m.
References abortAllLaunches, and allow_launching.
Referenced by DockSetProperty().
- (void) setDimensionsAndCorridor: | (BOOL) | ||
docking: | (BOOL) | ||
ddc: | (BOOL) | launching |
Definition at line 1137 of file DockEntity.m.
References allow_docking, allow_launching, Entity::boundingBox, disallowed_docking_collides, HPvector_forward_from_quaternion(), Entity::orientation, Entity::parentEntity, port_corridor, port_dimensions, Entity::position, virtual_dock, and StationEntity::virtualPortDimensions.
- (void) setDisallowedDockingCollides: | (BOOL) | ddc |
Definition at line 210 of file DockEntity.m.
References disallowed_docking_collides.
Referenced by DockSetProperty().
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1231 of file DockEntity.m.
References Entity::isShip, Entity::isStation, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
- (void) setVirtual |
Definition at line 216 of file DockEntity.m.
References setVirtual, and virtual_dock.
Referenced by ShipEntity::setUpOneStandardSubentity:asTurret:, and setVirtual.
- (BOOL) shipIsInDockingCorridor: | (ShipEntity *) | ship |
Definition at line 672 of file DockEntity.m.
References Entity::absolutePositionForSubentity, ShipEntity::adjustVelocity:, allow_docking, Entity::boundingBox, DEBUG_DOCKING, disallowed_docking_collides, DOCKING_CLEARANCE_STATUS_GRANTED, ShipEntity::doScriptEvent:withArgument:, ShipEntity::flightSpeed, ShipEntity::forwardVector, gDebugFlags, Entity::isPlayer, Entity::isShip, OOLog, Entity::orientation, Entity::parentEntity, PLAYER, port_dimensions, Entity::position, pullInShipIfPermitted:, quaternion_multiply(), Entity::setPosition:, Entity::status, ShipEntity::takeScrapeDamage:from:, vector_forward_from_quaternion(), vector_right_from_quaternion(), and vector_up_from_quaternion().
- (BOOL) shipIsInDockingQueue: | (ShipEntity *) | ship |
Definition at line 639 of file DockEntity.m.
References Entity::isPlayer, Entity::isShip, Entity::owner, shipsOnApproach, Entity::status, and Entity::universalID.
Referenced by DockIsQueued().
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1279 of file DockEntity.m.
References ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1246 of file DockEntity.m.
References count, dockingCorridorIsEmpty, launchQueue, launchShip:, no_docking_while_launching, shipsOnApproach, Entity::status, and ShipEntity::update:.
|
private |
Definition at line 46 of file DockEntity.h.
Referenced by allowsDocking, canAcceptShipForDocking:, initWithKey:definition:, setAllowsDocking:, setDimensionsAndCorridor:docking:ddc:, and shipIsInDockingCorridor:.
|
private |
Definition at line 45 of file DockEntity.h.
Referenced by allowsLaunching, canAcceptShipForDocking:, initWithKey:definition:, setAllowsLaunching:, and setDimensionsAndCorridor:docking:ddc:.
|
private |
Definition at line 47 of file DockEntity.h.
Referenced by disallowedDockingCollides, initWithKey:definition:, setDimensionsAndCorridor:docking:ddc:, setDisallowedDockingCollides:, and shipIsInDockingCorridor:.
|
private |
Definition at line 39 of file DockEntity.h.
Referenced by dockingInstructionsForShip:.
|
private |
Definition at line 36 of file DockEntity.h.
Referenced by abortAllDockings, dockingCorridorIsEmpty, launchShip:, noteDockingForShip:, and pruneAndCountShipsOnApproach.
|
private |
Definition at line 35 of file DockEntity.h.
Referenced by addShipToLaunchQueue:withPriority:, canAcceptShipForDocking:, countOfShipsInLaunchQueueWithPrimaryRole:, dealloc, initWithKey:definition:, and update:.
|
private |
Definition at line 44 of file DockEntity.h.
Referenced by abortAllDockings, abortAllLaunches, canAcceptShipForDocking:, launchShip:, and update:.
|
private |
Definition at line 42 of file DockEntity.h.
Referenced by launchShip:, and setDimensionsAndCorridor:docking:ddc:.
|
private |
Definition at line 41 of file DockEntity.h.
Referenced by allowsLaunchingOf:, canAcceptShipForDocking:, launchShip:, portUpVectorForShipsBoundingBox:, setDimensionsAndCorridor:docking:ddc:, and shipIsInDockingCorridor:.
|
private |
Definition at line 34 of file DockEntity.h.
Referenced by abortAllDockings, abortDockingForShip:, dealloc, dockingInstructionsForShip:, initWithKey:definition:, pruneAndCountShipsOnApproach, shipIsInDockingQueue:, and update:.
|
private |
Definition at line 48 of file DockEntity.h.
Referenced by drawImmediate:translucent:, initWithKey:definition:, noteTakingDamage:from:type:, setDimensionsAndCorridor:docking:ddc:, setVirtual, and takeEnergyDamage:from:becauseOf:weaponIdentifier:.