![]() |
Oolite 1.91.0.7658-250404-b1488af
|
#include <AI.h>
Class Methods | |
(AI *) | + currentlyRunningAI |
(NSString *) | + currentlyRunningAIDescription |
(void) | + deferredCallTrampolineWithInfo: [implementation] |
Private Attributes | |
id | _owner |
NSString * | ownerDesc |
NSDictionary * | stateMachine |
NSString * | stateMachineName |
NSString * | currentState |
NSMutableSet * | pendingMessages |
NSMutableArray * | aiStack |
OOTimeAbsolute | nextThinkTime |
OOTimeDelta | thinkTimeInterval |
NSString * | jsScript |
Additional Inherited Members | |
![]() | |
OOWeakReference * | weakSelf |
- (NSString *) associatedJS |
Definition at line 370 of file AI.m.
References associatedJS.
Referenced by associatedJS, and ShipEntity(LoadRestore)::savedShipDictionaryWithContext:.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 914 of file AI.m.
Referenced by AI(OOPrivate)::cleanHandlers:forState:stateMachine:.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 888 of file AI.m.
Referenced by AI(OOPrivate)::loadStateMachine:jsName:.
- (void) clearAllData |
Definition at line 691 of file AI.m.
References clearAllData, and nextThinkTime.
Referenced by clearAllData, PlayerEntity::resetAutopilotAI, ShipEntity::setAI:, and thinkTimeInterval.
- (void) clearStack |
Definition at line 685 of file AI.m.
References clearStack.
Referenced by clearStack, WormholeEntity::suckInShip:, ShipEntity(AI)::switchAITo:, and thinkTimeInterval.
+ (AI *) currentlyRunningAI |
Definition at line 107 of file AI.m.
References currentlyRunningAI, and sCurrentlyRunningAI.
Referenced by currentlyRunningAI.
+ (NSString *) currentlyRunningAIDescription |
Definition at line 113 of file AI.m.
References currentlyRunningAIDescription, name, nil, sCurrentlyRunningAI, and state.
Referenced by currentlyRunningAIDescription.
|
implementation |
Reimplemented from OOWeakRefObject.
Definition at line 152 of file AI.m.
References _owner, aiStack, currentState, dealloc, OOWeakRefObject::dealloc, DESTROY, jsScript, nil, ownerDesc, pendingMessages, sCurrentlyRunningAI, stateMachine, and stateMachineName.
Referenced by dealloc.
- (void) debugDumpPendingMessages |
Definition at line 639 of file AI.m.
References count, debugDumpPendingMessages, descriptionComponents, nil, OOLog, and pendingMessages.
Referenced by debugDumpPendingMessages, and pendingMessages.
|
implementation |
Provided by category AI(OOAIDebugInspectorModule).
Definition at line 102 of file OOAIDebugInspectorModule.m.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 740 of file AI.m.
|
implementation |
Definition at line 172 of file AI.m.
References descriptionComponents.
Referenced by debugDumpPendingMessages, and descriptionComponents.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 791 of file AI.m.
Referenced by restorePreviousStateMachine, setState:, and setStateMachine:withJSScript:.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 776 of file AI.m.
Referenced by restorePreviousStateMachine, and setStateMachine:withJSScript:.
- (void) dropMessage: | (NSString *) | ms |
- (void) dumpState |
Definition at line 700 of file AI.m.
References currentState, dumpState, nextThinkTime, OOLog, stateMachineName, and thinkTimeInterval.
Referenced by ShipEntity::dumpSelfState, dumpState, and thinkTimeInterval.
- (void) exitStateMachineWithMessage: | (NSString *) | message |
Definition at line 296 of file AI.m.
References aiStack, count, nil, reactToMessage:context:, and restorePreviousStateMachine.
Referenced by ShipEntity::behaviour_tractored:, ShipEntity::dumpItem:, ShipEntity::releaseCargoPodsDebris, ShipExitAI(), and ShipEntity::update:.
- (BOOL) hasSuspendedStateMachines |
Definition at line 290 of file AI.m.
References hasSuspendedStateMachines.
Referenced by hasSuspendedStateMachines.
|
implementation |
Definition at line 126 of file AI.m.
References AI_THINK_INTERVAL, init, nextThinkTime, stateMachineName, and thinkTimeInterval.
Referenced by init, and initWithStateMachine:andState:.
- (id) initWithStateMachine: | (NSString *) | smName | |
andState: | (NSString *) | stateName |
Definition at line 140 of file AI.m.
References currentState, init, nil, and setStateMachine:withJSScript:.
|
implementation |
Provided by category AI(OOAIDebugInspectorModule).
Definition at line 95 of file OOAIDebugInspectorModule.m.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 801 of file AI.m.
Referenced by setStateMachine:withJSScript:.
- (void) message: | (NSString *) | ms |
Definition at line 600 of file AI.m.
References count, EXPECT_NOT, nil, NO_TARGET, OOLogERR, owner, ownerDesc, and pendingMessages.
Referenced by StationEntity::abortAllDockings, ShipEntity::acceptAsEscort:, StationEntity::acceptDockingClearanceRequestFrom:, StationEntity::autoDockShipsOnApproach, ShipEntity::behaviour_face_destination:, ShipEntity::behaviour_flee_target:, ShipEntity::behaviour_fly_from_destination:, ShipEntity::behaviour_fly_to_destination:, ShipEntity::behaviour_land_on_planet:, ShipEntity::broadcastAIMessage:, ShipEntity::checkForAegis, DockEntity::dockingInstructionsForShip:, ShipEntity::enterDock:, ShipEntity::enterWitchspace, ShipEntity::noteLostTarget, ShipEntity::noteTargetDestroyed:, StationEntity::sanityCheckShipsOnApproach, ShipEntity(PureAI)::scanForNearestShipMatchingPredicate:, ShipEntity::scoopUpProcess:processEvents:processMessages:, ShipEntity::sendAIMessage:, ShipEntity::setTargetToNearestStationIncludingHostiles:, ShipEntity(PureAI)::setTargetToPrimaryAggressor, ShipEntity::setTargetToSystemStation, WormholeEntity::suckInShip:, ShipEntity::transitionToAegisNone, ShipEntity::update:, StationEntity::update:, and ShipEntity::witchspaceLeavingEffects.
- (NSString *) name |
Definition at line 364 of file AI.m.
References name.
Referenced by currentlyRunningAIDescription, ShipEntity::hasNewAI, AI(OOPrivate)::loadStateMachine:jsName:, name, reactToMessage:context:, reportStackOverflow, ShipEntity(PureAI)::safeScriptActionOnTarget:, ShipEntity(LoadRestore)::savedShipDictionaryWithContext:, ShipEntity(PureAI)::scanForNearestShipMatchingPredicate:, ShipEntity(PureAI)::scriptActionOnTarget:, ShipGetProperty(), OOAIDebugInspectorModule::update, and OOShipDebugInspectorModule::update.
- (OOTimeAbsolute) nextThinkTime |
References nextThinkTime.
- (ShipEntity *) owner |
Definition at line 184 of file AI.m.
References _owner, nil, and owner.
Referenced by AI(OOAIDebugInspectorModule)::inspBasicIdentityLine, message:, owner, preserveCurrentStateMachine, reactToMessage:context:, AI(OOPrivate)::refreshOwnerDesc, restorePreviousStateMachine, takeAction:, think, and OOAIDebugInspectorModule::update.
- (NSSet *) pendingMessages |
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 719 of file AI.m.
Referenced by setState:afterDelay:, and setStateMachine:afterDelay:.
- (void) preserveCurrentStateMachine |
Definition at line 231 of file AI.m.
References aiStack, count, kStackLimiter, nil, OOLog, owner, preserveCurrentStateMachine, reportStackOverflow, and stateMachine.
Referenced by preserveCurrentStateMachine, and setStateMachine:withJSScript:.
- (void) reactToMessage: | (NSString *) | message | |
context: | (NSString *) | debugContext |
Definition at line 404 of file AI.m.
References AIStackElement::aiName, AIStackElement::back, AIStackElement::context, count, currentState, kOOLogException, kRecursionLimiter, AIStackElement::message, name, nil, NO_TARGET, OOLog, OOLogERR, owner, AIStackElement::owner, ownerDesc, sCurrentlyRunningAI, sStack, AIStackElement::state, stateMachineName, and takeAction:.
Referenced by StationEntity::acceptDockingClearanceRequestFrom:, Universe::allShipsDoScriptEvent:andReactToAIMessage:, ShipEntity::behaviour_intercept_target:, ShipEntity::checkForAegis, StationEntity::dockingInstructionsForShip:, ShipEntity::enterWormhole:replacing:, exitStateMachineWithMessage:, PlayerEntity(Scripting)::messageShipAIs:, ShipEntity::noteLostTarget, ShipEntity::reactToAIMessage:context:, StationEntity::setAlertLevel:signallingScript:, setState:, setStateMachine:withJSScript:, think, and ShipEntity::update:.
|
implementation |
Provided by category AI(OOPrivate).
Definition at line 757 of file AI.m.
Referenced by setOwner:, and setStateMachine:withJSScript:.
|
implementation |
Definition at line 205 of file AI.m.
References _owner, count, currentState, name, OOLog, OOLogERR, OOLogIndent(), OOLogOutdent(), OOLogWillDisplayMessagesInClass(), reportStackOverflow, state, and stateMachineName.
Referenced by preserveCurrentStateMachine, and reportStackOverflow.
- (void) restorePreviousStateMachine |
Definition at line 265 of file AI.m.
References aiStack, count, directSetState:, directSetStateMachine:name:, OOPreservedAIStateMachine::jsScript, OOPreservedAIStateMachine::name, OOLog, owner, OOPreservedAIStateMachine::pendingMessages, pendingMessages, restorePreviousStateMachine, ShipEntity::setAIScript:, OOPreservedAIStateMachine::state, and OOPreservedAIStateMachine::stateMachine.
Referenced by exitStateMachineWithMessage:, and restorePreviousStateMachine.
- (void) setNextThinkTime: | (OOTimeAbsolute) | ntt |
Definition at line 658 of file AI.m.
References nextThinkTime.
Referenced by DockEntity::launchShip:, PlayerEntity::resetAutopilotAI, PlayerEntity(Scripting)::sendAllShipsAway, OOAIDebugInspectorModule::thinkNow:, and Universe::update:.
- (void) setOwner: | (ShipEntity *) | ship |
Definition at line 197 of file AI.m.
References _owner, refreshOwnerDesc, and OOWeakRefObject::weakRetain.
Referenced by Universe::addEntity:, PlayerEntity::resetAutopilotAI, and ShipEntity::setUpShipFromDictionary:.
- (void) setState: | (NSString *) | stateName |
Definition at line 334 of file AI.m.
References directSetState:, reactToMessage:context:, and stateMachine.
Referenced by Universe::addEntity:, PlayerEntity::engageAutopilotToStation:, PlayerEntity::resetAutopilotAI, PlayerEntity(Scripting)::sendAllShipsAway, ShipEntity(PureAI)::setStateTo:, ShipEntity(Private)::setUpOneEscort:inGroup:withRole:atPosition:andCount:, and ShipSetProperty().
- (void) setState: | (NSString *) | stateName | |
afterDelay: | (NSTimeInterval) | delay |
Definition at line 358 of file AI.m.
References performDeferredCall:withObject:afterDelay:.
Referenced by ShipEntity::dockEscorts.
- (void) setStateMachine: | (NSString *) | smName | |
afterDelay: | (NSTimeInterval) | delay |
Definition at line 352 of file AI.m.
References performDeferredCall:withObject:afterDelay:.
- (void) setStateMachine: | (NSString *) | smName | |
withJSScript: | (NSString *) | script |
Definition at line 307 of file AI.m.
References directSetState:, directSetStateMachine:name:, loadStateMachine:jsName:, nextThinkTime, preserveCurrentStateMachine, reactToMessage:context:, and refreshOwnerDesc.
Referenced by initWithStateMachine:andState:, and ShipEntity(AI)::setAITo:.
- (void) setThinkTimeInterval: | (OOTimeDelta) | tti |
Definition at line 673 of file AI.m.
References thinkTimeInterval.
|
implementation |
Definition at line 178 of file AI.m.
References shortDescriptionComponents.
Referenced by ShipEntity::descriptionForObjDump, and shortDescriptionComponents.
- (NSUInteger) stackDepth |
Definition at line 382 of file AI.m.
References stackDepth.
Referenced by stackDepth, and OOAIDebugInspectorModule::update.
- (NSString *) state |
Definition at line 376 of file AI.m.
References state.
Referenced by currentlyRunningAIDescription, AI(OOPrivate)::loadStateMachine:jsName:, reportStackOverflow, ShipEntity(PureAI)::safeScriptActionOnTarget:, ShipEntity(PureAI)::scriptActionOnTarget:, ShipGetProperty(), state, OOAIDebugInspectorModule::update, and OOShipDebugInspectorModule::update.
- (void) takeAction: | (NSString *) | action |
Definition at line 510 of file AI.m.
References count, currentState, nil, OOLog, OOLogERR, OOLogIndent(), OOLogOutdent(), owner, ownerDesc, ShipEntity::reportAIMessages, ScanTokensFromString(), and stateMachineName.
Referenced by reactToMessage:context:.
- (void) think |
Definition at line 575 of file AI.m.
References count, nil, NO_TARGET, owner, pendingMessages, reactToMessage:context:, stateMachine, and think.
Referenced by think, and Universe::update:.
- (OOTimeDelta) thinkTimeInterval |
References clearAllData, clearStack, dumpState, and thinkTimeInterval.
|
private |
|
private |
Definition at line 48 of file AI.h.
Referenced by dealloc, exitStateMachineWithMessage:, preserveCurrentStateMachine, and restorePreviousStateMachine.
|
private |
Definition at line 45 of file AI.h.
Referenced by dealloc, dumpState, initWithStateMachine:andState:, reactToMessage:context:, reportStackOverflow, and takeAction:.
|
private |
Definition at line 664 of file AI.m.
Referenced by clearAllData, dumpState, init, nextThinkTime, setNextThinkTime:, setStateMachine:withJSScript:, OOAIDebugInspectorModule::update, and Universe::update:.
|
private |
Definition at line 41 of file AI.h.
Referenced by dealloc, message:, reactToMessage:context:, and takeAction:.
|
private |
Definition at line 626 of file AI.m.
Referenced by dealloc, debugDumpPendingMessages, message:, pendingMessages, restorePreviousStateMachine, think, and OOAIDebugInspectorModule::update.
|
private |
|
private |
Definition at line 44 of file AI.h.
Referenced by dealloc, dumpState, init, reactToMessage:context:, reportStackOverflow, and takeAction:.
|
private |
Definition at line 679 of file AI.m.
Referenced by dumpState, init, setThinkTimeInterval:, thinkTimeInterval, and Universe::update:.