|
Oolite
|
#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 32 of file DockEntity.h.
| - (void) abortAllDockings |
Definition at line 89 of file DockEntity.m.
References abortAllDockings, Entity::absolutePositionForSubentity, clearAllIdLocks, DOCKING_CLEARANCE_STATUS_REQUESTED, ShipEntity::doScriptEvent:, PlayerEntity::getTargetDockStation, HPmagnitude2(), HPvector_subtract(), 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 129 of file DockEntity.m.
References abortAllLaunches, and no_docking_while_launching.
Referenced by abortAllLaunches, and setAllowsLaunching:.
| - (void) abortDockingForShip: | (ShipEntity*) | ship |
Definition at line 534 of file DockEntity.m.
References Entity::absolutePositionForSubentity, clearIdLocks:, DOCKING_CLEARANCE_STATUS_REQUESTED, HPmagnitude2(), HPvector_subtract(), 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 785 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 403 of file DockEntity.m.
References Entity::absolutePositionForSubentity, ShipEntity::entityPersonalityInt, HPcross_product(), HPdistance2(), HPvector_forward_from_quaternion(), M_PI, make_HPvector(), MAX, ONE_EIGHTH, Entity::position, quaternion_multiply(), ShipEntity::sendExpandedMessage:toShip:, Entity::universalID, UNIVERSE, HPVector::x, HPVector::y, and HPVector::z.
Referenced by dockingInstructionsForShip:.
| - (BOOL) allowsDocking |
Definition at line 153 of file DockEntity.m.
References allow_docking, and allowsDocking.
Referenced by allowsDocking.
| - (BOOL) allowsLaunching |
Definition at line 171 of file DockEntity.m.
References allow_launching, and allowsLaunching.
Referenced by allowsLaunching.
| - (BOOL) allowsLaunchingOf: | (ShipEntity*) | ship |
Definition at line 868 of file DockEntity.m.
References OOJSScript::callMethod:inContext:withArguments:count:result:, Entity::isPlayer, Entity::isShip, BoundingBox::max, BoundingBox::min, OOJSAcquireContext(), OOJSFreeValue, OOJSRelinquishContext(), OOJSUndefinedValue, OOJSValueFromNativeObject(), OOJSValueToBOOL(), port_dimensions, ShipEntity::script, ShipEntity::totalBoundingBox, Vector::x, and Vector::y.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 135 of file DockEntity.m.
References nil, and pullInShipIfPermitted:.
Referenced by autoDockShipsOnApproach.
| - (void) autoDockShipsOnApproach |
Definition at line 148 of file DockEntity.m.
References autoDockShipsInQueue:, and autoDockShipsOnApproach.
Referenced by autoDockShipsOnApproach, and StationEntity::autoDockShipsOnApproach.
| - (NSString *) canAcceptShipForDocking: | (ShipEntity*) | ship |
Definition at line 194 of file DockEntity.m.
References allow_docking, allow_launching, OOJSScript::callMethod:inContext:withArguments:count:result:, count, launchQueue, BoundingBox::max, BoundingBox::min, no_docking_while_launching, OOJSAcquireContext(), OOJSFreeValue, OOJSRelinquishContext(), OOJSUndefinedValue, OOJSValueFromNativeObject(), OOJSValueToBOOL(), port_dimensions, ShipEntity::script, ShipEntity::totalBoundingBox, Vector::x, and Vector::y.
Referenced by StationEntity::acceptDockingClearanceRequestFrom:, and StationEntity::dockingInstructionsForShip:.
| - (void) clear |
Definition at line 900 of file DockEntity.m.
References clear.
Referenced by clear, and StationEntity::clear.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 1107 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 972 of file DockEntity.m.
References Entity::absolutePositionForSubentity, clearDockingCorridor, dot_product(), HPdistance2(), HPvector_forward_from_quaternion(), Entity::isShip, make_vector(), Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), Entity::setPosition:, Entity::status, UNIVERSE, ShipEntity::update:, vector_forward_from_quaternion(), vector_normal(), HPVector::x, Vector::x, HPVector::y, Vector::y, HPVector::z, and Vector::z.
Referenced by clearDockingCorridor, and StationEntity::clearDockingCorridor.
|
implementation |
Provided by category DockEntity(OOPrivate).
Definition at line 1097 of file DockEntity.m.
References DESTROY, MAX_DOCKING_STAGES, and nil.
Referenced by abortDockingForShip:, dealloc, and dockingInstructionsForShip:.
| - (NSUInteger) countOfShipsInDockingQueue |
Definition at line 594 of file DockEntity.m.
References countOfShipsInDockingQueue.
Referenced by countOfShipsInDockingQueue, StationEntity::currentlyInDockingQueues, and StationEntity::dockingInstructionsForShip:.
| - (NSUInteger) countOfShipsInLaunchQueue |
Definition at line 599 of file DockEntity.m.
References countOfShipsInLaunchQueue.
Referenced by countOfShipsInLaunchQueue, and StationEntity::currentlyInLaunchingQueues.
| - (NSUInteger) countOfShipsInLaunchQueueWithPrimaryRole: | (NSString*) | role |
Definition at line 857 of file DockEntity.m.
References count, launchQueue, and nil.
Referenced by StationEntity(OOPrivate)::countOfShipsInLaunchQueueWithPrimaryRole:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1088 of file DockEntity.m.
References clearIdLocks:, dealloc, ShipEntity::dealloc, DESTROY, launchQueue, and shipsOnApproach.
Referenced by dealloc.
| - (BOOL) disallowedDockingCollides |
Definition at line 166 of file DockEntity.m.
References disallowed_docking_collides, and disallowedDockingCollides.
Referenced by disallowedDockingCollides.
| - (BOOL) dockingCorridorIsEmpty |
Definition at line 906 of file DockEntity.m.
References Entity::absolutePositionForSubentity, dockingCorridorIsEmpty, HPdistance2(), HPdot_product(), HPvector_forward_from_quaternion(), HPvector_normal(), Entity::isPlayer, Entity::isShip, last_launch_time, make_HPvector(), Entity::mass, Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), STATION_ALERT_LEVEL_RED, STATION_DELAY_BETWEEN_LAUNCHES, STATION_LAUNCH_RETRY_INTERVAL, Entity::status, UNIVERSE, HPVector::x, HPVector::y, and HPVector::z.
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 249 of file DockEntity.m.
References Entity::absolutePositionForSubentity, addShipToShipsOnApproach:, clearIdLocks:, Entity::collision_radius, Entity::collisionRadius, count, ShipEntity::getAI, HPcross_product(), HPdot_product(), HPmagnitude(), HPmagnitude2(), HPvector_forward_from_quaternion(), HPvector_normal(), HPvector_subtract(), id_lock, make_HPvector(), ShipEntity::maxFlightSpeed, AI::message:, nil, OOHPVectorTowards(), OOLogERR, OOMakeDockingInstructions(), Entity::orientation, Entity::parentEntity, Entity::position, quaternion_multiply(), SCANNER_MAX_RANGE, ShipEntity::sendExpandedMessage:toShip:, shipsOnApproach, Entity::universalID, OOWeakRefObject::weakRetain, HPVector::x, HPVector::y, and HPVector::z.
Referenced by StationEntity::dockingInstructionsForShip:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1167 of file DockEntity.m.
References ShipEntity::drawImmediate:translucent:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Provided by category DockEntity(OOJavaScriptExtensions).
Definition at line 139 of file OOJSDock.m.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1069 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 1064 of file DockEntity.m.
References isDock.
Referenced by isDock.
| - (BOOL) isOffCentre |
Definition at line 237 of file DockEntity.m.
References isOffCentre, Entity::orientation, Entity::position, vector_forward_from_quaternion(), Vector::x, and Vector::y.
Referenced by isOffCentre.
| - (void) launchShip: | (ShipEntity*) | ship |
Definition at line 804 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, magnitude(), BoundingBox::max, ShipEntity::maxFlightSpeed, BoundingBox::min, 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_add(), vector_forward_from_quaternion(), vector_multiply_scalar(), ShipEntity::velocity, Vector::x, and Vector::y.
Referenced by StationEntity::launchShip:, and update:.
| - (void) noteDockingForShip: | (ShipEntity*) | ship |
Definition at line 525 of file DockEntity.m.
References abortDockingForShip:, and last_launch_time.
Referenced by StationEntity::noteDockedShip:.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1148 of file DockEntity.m.
References ShipEntity::noteTakingDamage:from:type:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Provided by category DockEntity(OOJavaScriptExtensions).
Definition at line 145 of file OOJSDock.m.
|
implementation |
Reimplemented from ShipEntity.
Provided by category DockEntity(OOJavaScriptExtensions).
Definition at line 145 of file OOJSDock.m.
| - (Vector) portUpVectorForShipsBoundingBox: | (BoundingBox) | bb |
Definition at line 563 of file DockEntity.m.
References BoundingBox::max, BoundingBox::min, Entity::orientation, Entity::parentEntity, port_dimensions, quaternion_multiply(), vector_right_from_quaternion(), vector_up_from_quaternion(), Vector::x, and Vector::y.
Referenced by StationEntity::portUpVectorForShip:.
| - (NSUInteger) pruneAndCountShipsOnApproach |
Definition at line 60 of file DockEntity.m.
References Entity::absolutePositionForSubentity, count, ShipEntity::doScriptEvent:, HPmagnitude2(), HPvector_subtract(), 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 776 of file DockEntity.m.
References ShipEntity::enterDock:, and Entity::parentEntity.
Referenced by DockEntity(OOPrivate)::autoDockShipsInQueue:, and shipIsInDockingCorridor:.
| - (void) setAllowsDocking: | (BOOL) | allow |
Definition at line 158 of file DockEntity.m.
References abortAllDockings, and allow_docking.
Referenced by DockSetProperty(), and DockSetProperty().
| - (void) setAllowsLaunching: | (BOOL) | allow |
Definition at line 176 of file DockEntity.m.
References abortAllLaunches, and allow_launching.
Referenced by DockSetProperty(), and DockSetProperty().
| - (void) setDimensionsAndCorridor: | (BOOL) | docking | |
| ddc: | (BOOL) | ddc | |
| launching: | (BOOL) | launching |
Definition at line 1038 of file DockEntity.m.
References allow_docking, allow_launching, Entity::boundingBox, disallowed_docking_collides, HPvector_add(), HPvector_forward_from_quaternion(), HPvector_multiply_scalar(), make_vector(), BoundingBox::max, BoundingBox::min, Entity::orientation, Entity::parentEntity, port_corridor, port_dimensions, Entity::position, virtual_dock, StationEntity::virtualPortDimensions, HPVector::x, Vector::x, HPVector::y, Vector::y, HPVector::z, and Vector::z.
Referenced by ShipEntity::setUpOneStandardSubentity:asTurret:.
| - (void) setDisallowedDockingCollides: | (BOOL) | ddc |
Definition at line 184 of file DockEntity.m.
References disallowed_docking_collides.
Referenced by DockSetProperty(), and DockSetProperty().
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1115 of file DockEntity.m.
References Entity::isShip, Entity::isStation, OOJS_PROFILE_ENTER, and OOJS_PROFILE_EXIT.
| - (void) setVirtual |
Definition at line 189 of file DockEntity.m.
References setVirtual, and virtual_dock.
Referenced by ShipEntity::setUpOneStandardSubentity:asTurret:, and setVirtual.
| - (BOOL) shipIsInDockingCorridor: | (ShipEntity*) | ship |
Definition at line 604 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:, dot_product(), ShipEntity::findBoundingBoxRelativeToPosition:i:j:k:, ShipEntity::flightSpeed, ShipEntity::forwardVector, gDebugFlags, HPvector_multiply_scalar(), HPvector_normal(), HPvector_subtract(), Entity::isPlayer, Entity::isShip, BoundingBox::max, BoundingBox::min, 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(), vector_up_from_quaternion(), HPVector::x, Vector::x, HPVector::y, Vector::y, HPVector::z, and Vector::z.
| - (BOOL) shipIsInDockingQueue: | (ShipEntity*) | ship |
Definition at line 574 of file DockEntity.m.
References Entity::isPlayer, Entity::isShip, Entity::owner, shipsOnApproach, Entity::status, and Entity::universalID.
Referenced by DockIsQueued(), and DockIsQueued().
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1157 of file DockEntity.m.
References ShipEntity::takeEnergyDamage:from:becauseOf:weaponIdentifier:, and virtual_dock.
|
implementation |
Reimplemented from ShipEntity.
Definition at line 1130 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:ddc:launching:, and shipIsInDockingCorridor:.
|
private |
Definition at line 45 of file DockEntity.h.
Referenced by allowsLaunching, canAcceptShipForDocking:, initWithKey:definition:, setAllowsLaunching:, and setDimensionsAndCorridor:ddc:launching:.
|
private |
Definition at line 47 of file DockEntity.h.
Referenced by disallowedDockingCollides, initWithKey:definition:, setDimensionsAndCorridor:ddc:launching:, 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:ddc:launching:.
|
private |
Definition at line 41 of file DockEntity.h.
Referenced by allowsLaunchingOf:, canAcceptShipForDocking:, launchShip:, portUpVectorForShipsBoundingBox:, setDimensionsAndCorridor:ddc:launching:, 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:ddc:launching:, setVirtual, and takeEnergyDamage:from:becauseOf:weaponIdentifier:.