Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOShipDebugInspectorModule Class Reference

#include <OOShipDebugInspectorModule.h>

+ Inheritance diagram for OOShipDebugInspectorModule:
+ Collaboration diagram for OOShipDebugInspectorModule:

Instance Methods

(IBAction) - inspectPlayer:
 
(IBAction) - inspectTarget:
 
(IBAction) - inspectAI:
 
(IBAction) - inspectGroup:
 
(IBAction) - inspectEscortGroup:
 
(IBAction) - takeReportAIMessagesFrom:
 
(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 * _primaryRoleField
 
IBOutlet NSTextField * _otherRolesField
 
IBOutlet NSTextField * _targetField
 
IBOutlet NSTextField * _AIField
 
IBOutlet NSButton * _reportAIMessagesCheckBox
 
IBOutlet NSTextField * _scriptField
 
IBOutlet NSTextField * _groupField
 
IBOutlet NSTextField * _escortGroupField
 
IBOutlet NSTextField * _laserTempField
 
IBOutlet NSLevelIndicator * _laserTempIndicator
 
IBOutlet NSTextField * _cabinTempField
 
IBOutlet NSLevelIndicator * _cabinTempIndicator
 
IBOutlet NSTextField * _fuelField
 
IBOutlet NSLevelIndicator * _fuelIndicator
 

Detailed Description

Definition at line 33 of file OOShipDebugInspectorModule.h.

Method Documentation

◆ inspectAI:

- (IBAction) inspectAI: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

130 :sender
131{
132 [[[self object] getAI] inspect];
133}

◆ inspectEscortGroup:

- (IBAction) inspectEscortGroup: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

142 :sender
143{
144 [[[self object] rawEscortGroup] inspect];
145}

◆ inspectGroup:

- (IBAction) inspectGroup: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

136 :sender
137{
138 [[[self object] group] inspect];
139}

◆ inspectPlayer:

- (IBAction) inspectPlayer: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

118 :sender
119{
120 [[self object] inspect];
121}

◆ inspectTarget:

- (IBAction) inspectTarget: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

124 :sender
125{
126 [[[self object] primaryTarget] inspect];
127}

◆ takeReportAIMessagesFrom:

- (IBAction) takeReportAIMessagesFrom: (id) sender

Definition at line 1 of file OOShipDebugInspectorModule.m.

148 :sender
149{
150 [[self object] setReportAIMessages:[(NSButton *)sender state]];
151}

◆ update

- (void) update
implementation

Reimplemented from OODebugInspectorModule.

Definition at line 1 of file OOShipDebugInspectorModule.m.

52{
53 ShipEntity *object = [self object];
54 NSString *primaryRole = [object primaryRole];
55 NSMutableSet *roles = nil;
56 NSString *placeholder = InspectorUnknownValueString();
57 AI *objAI = nil;
58 NSString *desc = nil;
59 float level;
60 int fuel;
61
62 roles = [[[[object roleSet] roles] mutableCopy] autorelease];
63 [roles removeObject:primaryRole];
64
65 [_primaryRoleField setStringValue:primaryRole ?: placeholder];
66 if ([roles count] != 0)
67 {
68 desc = [[[roles allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] componentsJoinedByString:@", "];
69 [_otherRolesField setStringValue:desc];
70 }
71 else
72 {
73 [_otherRolesField setStringValue:placeholder];
74 }
75 [_targetField setStringValue:[object inspTargetLine] ?: placeholder];
76 objAI = [object getAI];
77 if (objAI != nil)
78 {
79 desc = [objAI name];
80 if ([desc hasSuffix:@".plist"]) desc = [desc stringByDeletingPathExtension];
81 desc = [NSString stringWithFormat:@"%@: %@", desc, [objAI state]];
82 [_AIField setStringValue:desc];
83 }
84 else
85 {
86 [_AIField setStringValue:placeholder];
87 }
88 [_reportAIMessagesCheckBox setState:[object reportAIMessages]];
89 [_scriptField setStringValue:[[object script] name] ?: placeholder];
90
91 [_groupField setStringValue:[[object group] inspDescription] ?: placeholder];
92 [_escortGroupField setStringValue:[[object rawEscortGroup] inspDescription] ?: placeholder];
93
94 if (object != nil)
95 {
96 level = [object laserHeatLevel];
97 [_laserTempField setStringValue:[NSString stringWithFormat:@"%.2f", level]];
98 [_laserTempIndicator setFloatValue:level * 100.0];
99 level = [object hullHeatLevel];
100 [_cabinTempField setStringValue:[NSString stringWithFormat:@"%.2f", level]];
101 [_cabinTempIndicator setFloatValue:level * 100.0];
102 fuel = [object fuel];
103 [_fuelField setStringValue:[NSString stringWithFormat:@"%.1f", (float)fuel / 10.0f]];
104 [_fuelIndicator setIntValue:fuel];
105 }
106 else
107 {
108 [_laserTempField setStringValue:placeholder];
109 [_laserTempIndicator setFloatValue:0];
110 [_cabinTempField setStringValue:placeholder];
111 [_cabinTempIndicator setFloatValue:0];
112 [_fuelField setStringValue:placeholder];
113 [_fuelIndicator setFloatValue:0];
114 }
115}
NSString * InspectorUnknownValueString(void)
unsigned count
return nil
Definition AI.h:38
NSString * name()
Definition AI.m:364
NSString * state()
Definition AI.m:376
NSString * name
Definition OOJSScript.h:37
NSSet * roles()
Definition OORoleSet.m:171
unsigned reportAIMessages
Definition ShipEntity.h:255
OORoleSet * roleSet
Definition ShipEntity.h:332
NSString * primaryRole
Definition ShipEntity.h:333
OOShipGroup * group()
OOFuelQuantity fuel
Definition ShipEntity.h:288
OOShipGroup * rawEscortGroup()
OOJSScript * script
Definition ShipEntity.h:222
GLfloat laserHeatLevel()
GLfloat hullHeatLevel()

Member Data Documentation

◆ _AIField

- (IBOutlet NSTextField*) _AIField
private

Definition at line 39 of file OOShipDebugInspectorModule.h.

◆ _cabinTempField

- (IBOutlet NSTextField*) _cabinTempField
private

Definition at line 46 of file OOShipDebugInspectorModule.h.

◆ _cabinTempIndicator

- (IBOutlet NSLevelIndicator*) _cabinTempIndicator
private

Definition at line 47 of file OOShipDebugInspectorModule.h.

◆ _escortGroupField

- (IBOutlet NSTextField*) _escortGroupField
private

Definition at line 43 of file OOShipDebugInspectorModule.h.

◆ _fuelField

- (IBOutlet NSTextField*) _fuelField
private

Definition at line 48 of file OOShipDebugInspectorModule.h.

◆ _fuelIndicator

- (IBOutlet NSLevelIndicator*) _fuelIndicator
private

Definition at line 49 of file OOShipDebugInspectorModule.h.

◆ _groupField

- (IBOutlet NSTextField*) _groupField
private

Definition at line 42 of file OOShipDebugInspectorModule.h.

◆ _laserTempField

- (IBOutlet NSTextField*) _laserTempField
private

Definition at line 44 of file OOShipDebugInspectorModule.h.

◆ _laserTempIndicator

- (IBOutlet NSLevelIndicator*) _laserTempIndicator
private

Definition at line 45 of file OOShipDebugInspectorModule.h.

◆ _otherRolesField

- (IBOutlet NSTextField*) _otherRolesField
private

Definition at line 37 of file OOShipDebugInspectorModule.h.

◆ _primaryRoleField

- (IBOutlet NSTextField*) _primaryRoleField
private

Definition at line 36 of file OOShipDebugInspectorModule.h.

◆ _reportAIMessagesCheckBox

- (IBOutlet NSButton*) _reportAIMessagesCheckBox
private

Definition at line 40 of file OOShipDebugInspectorModule.h.

◆ _scriptField

- (IBOutlet NSTextField*) _scriptField
private

Definition at line 41 of file OOShipDebugInspectorModule.h.

◆ _targetField

- (IBOutlet NSTextField*) _targetField
private

Definition at line 38 of file OOShipDebugInspectorModule.h.


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