Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOAIDebugInspectorModule Class Reference

#include <OOAIDebugInspectorModule.h>

+ Inheritance diagram for OOAIDebugInspectorModule:
+ Collaboration diagram for OOAIDebugInspectorModule:

Instance Methods

(IBAction) - dumpPendingMessages:
 
(IBAction) - thinkNow:
 
(void) - update [implementation]
 
- Instance Methods inherited from OODebugInspectorModule
(id) - initWithObject:
 
(BOOL) - loadUserInterface
 
(NSString *) - nibName
 
(NSView *) - rootView
 
(id) - object
 
(void) - dealloc [implementation]
 

Private Attributes

IBOutlet NSTextField * _stateMachineNameField
 
IBOutlet NSTextField * _stateField
 
IBOutlet NSTextField * _stackDepthField
 
IBOutlet NSTextField * _pendingMessagesField
 
IBOutlet NSTextField * _timeToThinkField
 
IBOutlet NSTextField * _behaviourField
 
IBOutlet NSTextField * _frustrationField
 

Detailed Description

Definition at line 33 of file OOAIDebugInspectorModule.h.

Method Documentation

◆ dumpPendingMessages:

- (IBAction) dumpPendingMessages: (id) sender

Definition at line 1 of file OOAIDebugInspectorModule.m.

85 :sender
86{
87 [[self object] debugDumpPendingMessages];
88}

◆ thinkNow:

- (IBAction) thinkNow: (id) sender

Definition at line 1 of file OOAIDebugInspectorModule.m.

79 :sender
80{
81 [[self object] setNextThinkTime:[UNIVERSE getTime]];
82}

◆ update

- (void) update
implementation

Reimplemented from OODebugInspectorModule.

Definition at line 1 of file OOAIDebugInspectorModule.m.

41{
42 AI *object = [self object];
43 NSString *placeholder = InspectorUnknownValueString();
44 NSSet *pending = nil;
45 NSString *pendingDesc = nil;
46
47 [_stateMachineNameField setStringValue:[object name] ?: placeholder];
48 [_stateField setStringValue:[object state] ?: placeholder];
49 if (object != nil)
50 {
51 [_stackDepthField setIntegerValue:[object stackDepth]];
52 [_timeToThinkField setStringValue:[NSString stringWithFormat:@"%.1f", [object nextThinkTime] - [UNIVERSE getTime]]];
53 [_behaviourField setStringValue:OOStringFromBehaviour([[object owner] behaviour])];
54 [_frustrationField setDoubleValue:[[object owner] frustration]];
55 }
56 else
57 {
58 [_stackDepthField setStringValue:placeholder];
59 [_timeToThinkField setStringValue:placeholder];
60 [_behaviourField setStringValue:placeholder];
61 [_frustrationField setStringValue:placeholder];
62 }
63
64 pending = [object pendingMessages];
65 if ([pending count] == 0)
66 {
67 pendingDesc = @"none";
68 }
69 else
70 {
71 pendingDesc = [[[pending allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] componentsJoinedByString:@", "];
72 pendingDesc = [NSString stringWithFormat:@"%lu: %@", [pending count], pendingDesc];
73 }
74
75 [_pendingMessagesField setStringValue:pendingDesc];
76}
NSString * InspectorUnknownValueString(void)
unsigned count
return nil
Definition AI.h:38
NSUInteger stackDepth()
Definition AI.m:382
NSMutableSet * pendingMessages
Definition AI.h:46
NSString * name()
Definition AI.m:364
ShipEntity * owner()
Definition AI.m:184
OOTimeAbsolute nextThinkTime
Definition AI.h:50
NSString * state()
Definition AI.m:376
GLfloat frustration
Definition ShipEntity.h:348
OOBehaviour behaviour
Definition ShipEntity.h:211

Member Data Documentation

◆ _behaviourField

- (IBOutlet NSTextField*) _behaviourField
private

Definition at line 41 of file OOAIDebugInspectorModule.h.

◆ _frustrationField

- (IBOutlet NSTextField*) _frustrationField
private

Definition at line 42 of file OOAIDebugInspectorModule.h.

◆ _pendingMessagesField

- (IBOutlet NSTextField*) _pendingMessagesField
private

Definition at line 39 of file OOAIDebugInspectorModule.h.

◆ _stackDepthField

- (IBOutlet NSTextField*) _stackDepthField
private

Definition at line 38 of file OOAIDebugInspectorModule.h.

◆ _stateField

- (IBOutlet NSTextField*) _stateField
private

Definition at line 37 of file OOAIDebugInspectorModule.h.

◆ _stateMachineNameField

- (IBOutlet NSTextField*) _stateMachineNameField
private

Definition at line 36 of file OOAIDebugInspectorModule.h.

◆ _timeToThinkField

- (IBOutlet NSTextField*) _timeToThinkField
private

Definition at line 40 of file OOAIDebugInspectorModule.h.


The documentation for this class was generated from the following files: