Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
ShipEntity.h File Reference
import "OOEntityWithDrawable.h"
import "OOPlanetEntity.h"
import "OOJSPropID.h"
#include "OOBehaviour.tbl"
#include "OOShipDamageType.tbl"
+ Include dependency graph for ShipEntity.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ShipEntity
 
category  ShipEntity(Debug)
 
category  Entity(SubEntityRelationship)
 

Macros

#define MAX_TARGETS   24
 
#define RAIDER_MAX_CARGO   5
 
#define MERCHANTMAN_MAX_CARGO   125
 
#define PIRATES_PREFER_PLAYER   YES
 
#define TURRET_MINIMUM_COS   0.20f
 
#define SHIP_THRUST_FACTOR   5.0f
 
#define AFTERBURNER_BURNRATE   0.25f
 
#define CLOAKING_DEVICE_ENERGY_RATE   12.8f
 
#define CLOAKING_DEVICE_MIN_ENERGY   128
 
#define CLOAKING_DEVICE_START_ENERGY   0.75f
 
#define MILITARY_JAMMER_ENERGY_RATE   3
 
#define MILITARY_JAMMER_MIN_ENERGY   128
 
#define COMBAT_IN_RANGE_FACTOR   0.035f
 
#define COMBAT_BROADSIDE_IN_RANGE_FACTOR   0.020f
 
#define COMBAT_OUT_RANGE_FACTOR   0.500f
 
#define COMBAT_BROADSIDE_RANGE_FACTOR   0.900f
 
#define COMBAT_WEAPON_RANGE_FACTOR   1.200f
 
#define COMBAT_JINK_OFFSET   500.0f
 
#define SHIP_COOLING_FACTOR   0.1f
 
#define SHIP_ENERGY_DAMAGE_TO_HEAT_FACTOR   (mass > 400000 ? 200000 / mass : 0.5)
 
#define SHIP_INSULATION_FACTOR   0.00175f
 
#define SHIP_MAX_CABIN_TEMP   256.0f
 
#define SHIP_MIN_CABIN_TEMP   60.0f
 
#define EJECTA_TEMP_FACTOR   0.85f
 
#define DEFAULT_HYPERSPACE_SPIN_TIME   15.0f
 
#define SUN_TEMPERATURE   1250.0f
 
#define MAX_ESCORTS   16
 
#define ESCORT_SPACING_FACTOR   3.0
 
#define SHIPENTITY_MAX_MISSILES   32
 
#define TURRET_TYPICAL_ENERGY   25.0f
 
#define TURRET_SHOT_SPEED   2000.0f
 
#define TURRET_SHOT_DURATION   3.0
 
#define TURRET_SHOT_RANGE   (TURRET_SHOT_SPEED * TURRET_SHOT_DURATION)
 
#define TURRET_SHOT_FREQUENCY   (TURRET_SHOT_DURATION * TURRET_SHOT_DURATION * TURRET_SHOT_DURATION / 100.0)
 
#define NPC_PLASMA_SPEED   1500.0f
 
#define MAIN_PLASMA_DURATION   5.0
 
#define NPC_PLASMA_RANGE   (MAIN_PLASMA_DURATION * NPC_PLASMA_SPEED)
 
#define PLAYER_PLASMA_SPEED   1000.0f
 
#define PLAYER_PLASMA_RANGE   (MAIN_PLASMA_DURATION * PLAYER_PLASMA_SPEED)
 
#define TRACTOR_FORCE   2500.0f
 
#define AIMS_AGGRESSOR_SWITCHED_TARGET   @"AGGRESSOR_SWITCHED_TARGET"
 
#define MAX_SCAN_NUMBER   32
 
#define BASELINE_SHIELD_LEVEL   128.0f
 
#define INITIAL_SHOT_TIME   100.0
 
#define MIN_FUEL   0
 
#define MAX_JUMP_RANGE   7.0
 
#define ENTITY_PERSONALITY_MAX   0x7FFFU
 
#define ENTITY_PERSONALITY_INVALID   0xFFFFU
 
#define WEAPON_COOLING_FACTOR   6.0f
 
#define NPC_MAX_WEAPON_TEMP   256.0f
 
#define WEAPON_COOLING_CUTOUT   0.85f
 
#define COMBAT_AI_WEAPON_TEMP_READY   0.25f * NPC_MAX_WEAPON_TEMP
 
#define COMBAT_AI_WEAPON_TEMP_USABLE   WEAPON_COOLING_CUTOUT * NPC_MAX_WEAPON_TEMP
 
#define COMBAT_AI_CONFIDENCE_FACTOR   1250000.0f
 
#define COMBAT_AI_ISNT_AWFUL   0.0f
 
#define COMBAT_AI_IS_SMART   5.0f
 
#define COMBAT_AI_FLEES_BETTER   6.0f
 
#define COMBAT_AI_DOGFIGHTER   6.5f
 
#define COMBAT_AI_TRACKS_CLOSER   7.5f
 
#define COMBAT_AI_USES_SNIPING   8.5f
 
#define COMBAT_AI_FLEES_BETTER_2   9.0f
 
#define COMBAT_AI_STANDARD_REACTION_TIME   1.5f
 
#define MAX_LANDING_SPEED   50.0
 
#define MAX_LANDING_SPEED2   (MAX_LANDING_SPEED * MAX_LANDING_SPEED)
 
#define MAX_COS   0.995
 
#define MAX_COS2   (MAX_COS * MAX_COS)
 
#define ENTRY(label, value)   label = value,
 
#define DIFF_STRING_ENTRY(label, string)   label,
 
#define ShipScriptEvent(context, ship, event, ...)
 
#define ShipScriptEventNoCx(ship, event, ...)
 

Typedefs

typedef enum OOBehaviour OOBehaviour
 
typedef OOEquipmentTypeOOWeaponType
 

Enumerations

enum  OOBehaviour
 
enum  OOAlertCondition { ALERT_CONDITION_DOCKED = 0 , ALERT_CONDITION_GREEN = 1 , ALERT_CONDITION_YELLOW = 2 , ALERT_CONDITION_RED = 3 }
 
enum  OOShipDamageType { kOOShipDamageTypeDefault = kOODamageTypeEnergy }
 

Functions

NSDictionary * OODefaultShipShaderMacros (void)
 
GLfloat getWeaponRangeFromType (OOWeaponType weapon_type)
 
NSString * OOStringFromBehaviour (OOBehaviour behaviour) CONST_FUNC
 
NSString * OOEquipmentIdentifierFromWeaponType (OOWeaponType weapon) CONST_FUNC
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy (NSString *string) PURE_FUNC
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierStrict (NSString *string) PURE_FUNC
 
OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy (NSString *string)
 
NSString * OOStringFromWeaponType (OOWeaponType weapon) CONST_FUNC
 
OOWeaponType OOWeaponTypeFromString (NSString *string) PURE_FUNC
 
BOOL isWeaponNone (OOWeaponType weapon)
 
NSString * OODisplayStringFromAlertCondition (OOAlertCondition alertCondition)
 
NSString * OOStringFromShipDamageType (OOShipDamageType type) CONST_FUNC
 

Macro Definition Documentation

◆ AFTERBURNER_BURNRATE

#define AFTERBURNER_BURNRATE   0.25f

Definition at line 45 of file ShipEntity.h.

◆ AIMS_AGGRESSOR_SWITCHED_TARGET

#define AIMS_AGGRESSOR_SWITCHED_TARGET   @"AGGRESSOR_SWITCHED_TARGET"

Definition at line 94 of file ShipEntity.h.

◆ BASELINE_SHIELD_LEVEL

#define BASELINE_SHIELD_LEVEL   128.0f

Definition at line 99 of file ShipEntity.h.

◆ CLOAKING_DEVICE_ENERGY_RATE

#define CLOAKING_DEVICE_ENERGY_RATE   12.8f

Definition at line 47 of file ShipEntity.h.

◆ CLOAKING_DEVICE_MIN_ENERGY

#define CLOAKING_DEVICE_MIN_ENERGY   128

Definition at line 48 of file ShipEntity.h.

◆ CLOAKING_DEVICE_START_ENERGY

#define CLOAKING_DEVICE_START_ENERGY   0.75f

Definition at line 49 of file ShipEntity.h.

◆ COMBAT_AI_CONFIDENCE_FACTOR

#define COMBAT_AI_CONFIDENCE_FACTOR   1250000.0f

Definition at line 122 of file ShipEntity.h.

◆ COMBAT_AI_DOGFIGHTER

#define COMBAT_AI_DOGFIGHTER   6.5f

Definition at line 129 of file ShipEntity.h.

◆ COMBAT_AI_FLEES_BETTER

#define COMBAT_AI_FLEES_BETTER   6.0f

Definition at line 127 of file ShipEntity.h.

◆ COMBAT_AI_FLEES_BETTER_2

#define COMBAT_AI_FLEES_BETTER_2   9.0f

Definition at line 134 of file ShipEntity.h.

◆ COMBAT_AI_IS_SMART

#define COMBAT_AI_IS_SMART   5.0f

Definition at line 125 of file ShipEntity.h.

◆ COMBAT_AI_ISNT_AWFUL

#define COMBAT_AI_ISNT_AWFUL   0.0f

Definition at line 123 of file ShipEntity.h.

◆ COMBAT_AI_STANDARD_REACTION_TIME

#define COMBAT_AI_STANDARD_REACTION_TIME   1.5f

Definition at line 136 of file ShipEntity.h.

◆ COMBAT_AI_TRACKS_CLOSER

#define COMBAT_AI_TRACKS_CLOSER   7.5f

Definition at line 131 of file ShipEntity.h.

◆ COMBAT_AI_USES_SNIPING

#define COMBAT_AI_USES_SNIPING   8.5f

Definition at line 132 of file ShipEntity.h.

◆ COMBAT_AI_WEAPON_TEMP_READY

#define COMBAT_AI_WEAPON_TEMP_READY   0.25f * NPC_MAX_WEAPON_TEMP

Definition at line 118 of file ShipEntity.h.

◆ COMBAT_AI_WEAPON_TEMP_USABLE

#define COMBAT_AI_WEAPON_TEMP_USABLE   WEAPON_COOLING_CUTOUT * NPC_MAX_WEAPON_TEMP

Definition at line 119 of file ShipEntity.h.

◆ COMBAT_BROADSIDE_IN_RANGE_FACTOR

#define COMBAT_BROADSIDE_IN_RANGE_FACTOR   0.020f

Definition at line 55 of file ShipEntity.h.

◆ COMBAT_BROADSIDE_RANGE_FACTOR

#define COMBAT_BROADSIDE_RANGE_FACTOR   0.900f

Definition at line 57 of file ShipEntity.h.

◆ COMBAT_IN_RANGE_FACTOR

#define COMBAT_IN_RANGE_FACTOR   0.035f

Definition at line 54 of file ShipEntity.h.

◆ COMBAT_JINK_OFFSET

#define COMBAT_JINK_OFFSET   500.0f

Definition at line 59 of file ShipEntity.h.

◆ COMBAT_OUT_RANGE_FACTOR

#define COMBAT_OUT_RANGE_FACTOR   0.500f

Definition at line 56 of file ShipEntity.h.

◆ COMBAT_WEAPON_RANGE_FACTOR

#define COMBAT_WEAPON_RANGE_FACTOR   1.200f

Definition at line 58 of file ShipEntity.h.

◆ DEFAULT_HYPERSPACE_SPIN_TIME

#define DEFAULT_HYPERSPACE_SPIN_TIME   15.0f

Definition at line 70 of file ShipEntity.h.

◆ DIFF_STRING_ENTRY

#define DIFF_STRING_ENTRY ( label,
string )   label,

Definition at line 184 of file ShipEntity.h.

◆ EJECTA_TEMP_FACTOR

#define EJECTA_TEMP_FACTOR   0.85f

Definition at line 69 of file ShipEntity.h.

◆ ENTITY_PERSONALITY_INVALID

#define ENTITY_PERSONALITY_INVALID   0xFFFFU

Definition at line 111 of file ShipEntity.h.

Referenced by PersonalityForCommanderDict().

◆ ENTITY_PERSONALITY_MAX

#define ENTITY_PERSONALITY_MAX   0x7FFFU

Definition at line 110 of file ShipEntity.h.

Referenced by PersonalityForCommanderDict(), PlayerReplaceShip(), and ShipSetProperty().

◆ ENTRY

#define ENTRY ( label,
value )   label = value,

Definition at line 147 of file ShipEntity.h.

◆ ESCORT_SPACING_FACTOR

#define ESCORT_SPACING_FACTOR   3.0

Definition at line 75 of file ShipEntity.h.

◆ INITIAL_SHOT_TIME

#define INITIAL_SHOT_TIME   100.0

Definition at line 100 of file ShipEntity.h.

◆ MAIN_PLASMA_DURATION

#define MAIN_PLASMA_DURATION   5.0

Definition at line 86 of file ShipEntity.h.

◆ MAX_COS

#define MAX_COS   0.995

Definition at line 143 of file ShipEntity.h.

◆ MAX_COS2

#define MAX_COS2   (MAX_COS * MAX_COS)

Definition at line 144 of file ShipEntity.h.

◆ MAX_ESCORTS

#define MAX_ESCORTS   16

Definition at line 74 of file ShipEntity.h.

Referenced by ShipSetProperty().

◆ MAX_JUMP_RANGE

#define MAX_JUMP_RANGE   7.0

Definition at line 107 of file ShipEntity.h.

Referenced by PlayerSetEscapePodDestination(), and ShipSetProperty().

◆ MAX_LANDING_SPEED

#define MAX_LANDING_SPEED   50.0

Definition at line 140 of file ShipEntity.h.

◆ MAX_LANDING_SPEED2

#define MAX_LANDING_SPEED2   (MAX_LANDING_SPEED * MAX_LANDING_SPEED)

Definition at line 141 of file ShipEntity.h.

◆ MAX_SCAN_NUMBER

#define MAX_SCAN_NUMBER   32

Definition at line 97 of file ShipEntity.h.

◆ MAX_TARGETS

#define MAX_TARGETS   24

Definition at line 36 of file ShipEntity.h.

◆ MERCHANTMAN_MAX_CARGO

#define MERCHANTMAN_MAX_CARGO   125

Definition at line 38 of file ShipEntity.h.

◆ MILITARY_JAMMER_ENERGY_RATE

#define MILITARY_JAMMER_ENERGY_RATE   3

Definition at line 51 of file ShipEntity.h.

◆ MILITARY_JAMMER_MIN_ENERGY

#define MILITARY_JAMMER_MIN_ENERGY   128

Definition at line 52 of file ShipEntity.h.

◆ MIN_FUEL

#define MIN_FUEL   0

Definition at line 102 of file ShipEntity.h.

◆ NPC_MAX_WEAPON_TEMP

#define NPC_MAX_WEAPON_TEMP   256.0f

Definition at line 115 of file ShipEntity.h.

◆ NPC_PLASMA_RANGE

#define NPC_PLASMA_RANGE   (MAIN_PLASMA_DURATION * NPC_PLASMA_SPEED)

Definition at line 87 of file ShipEntity.h.

◆ NPC_PLASMA_SPEED

#define NPC_PLASMA_SPEED   1500.0f

Definition at line 85 of file ShipEntity.h.

◆ PIRATES_PREFER_PLAYER

#define PIRATES_PREFER_PLAYER   YES

Definition at line 40 of file ShipEntity.h.

◆ PLAYER_PLASMA_RANGE

#define PLAYER_PLASMA_RANGE   (MAIN_PLASMA_DURATION * PLAYER_PLASMA_SPEED)

Definition at line 90 of file ShipEntity.h.

◆ PLAYER_PLASMA_SPEED

#define PLAYER_PLASMA_SPEED   1000.0f

Definition at line 89 of file ShipEntity.h.

◆ RAIDER_MAX_CARGO

#define RAIDER_MAX_CARGO   5

Definition at line 37 of file ShipEntity.h.

◆ SHIP_COOLING_FACTOR

#define SHIP_COOLING_FACTOR   0.1f

Definition at line 61 of file ShipEntity.h.

◆ SHIP_ENERGY_DAMAGE_TO_HEAT_FACTOR

#define SHIP_ENERGY_DAMAGE_TO_HEAT_FACTOR   (mass > 400000 ? 200000 / mass : 0.5)

Definition at line 65 of file ShipEntity.h.

◆ SHIP_INSULATION_FACTOR

#define SHIP_INSULATION_FACTOR   0.00175f

Definition at line 66 of file ShipEntity.h.

◆ SHIP_MAX_CABIN_TEMP

#define SHIP_MAX_CABIN_TEMP   256.0f

Definition at line 67 of file ShipEntity.h.

Referenced by ShipGetProperty().

◆ SHIP_MIN_CABIN_TEMP

#define SHIP_MIN_CABIN_TEMP   60.0f

Definition at line 68 of file ShipEntity.h.

◆ SHIP_THRUST_FACTOR

#define SHIP_THRUST_FACTOR   5.0f

Definition at line 44 of file ShipEntity.h.

◆ SHIPENTITY_MAX_MISSILES

#define SHIPENTITY_MAX_MISSILES   32

Definition at line 77 of file ShipEntity.h.

◆ ShipScriptEvent

#define ShipScriptEvent ( context,
ship,
event,
... )
Value:
do { \
jsval argv[] = { __VA_ARGS__ }; \
uintN argc = sizeof argv / sizeof *argv; \
[ship doScriptEvent:OOJSID(event) inContext:context withArguments:argv count:argc]; \
} while (0)
#define OOJSID(str)
Definition OOJSPropID.h:38
unsigned count

Definition at line 1267 of file ShipEntity.h.

1267jsval argv[] = { __VA_ARGS__ }; \
1268uintN argc = sizeof argv / sizeof *argv; \
1269[ship doScriptEvent:OOJSID(event) inContext:context withArguments:argv count:argc]; \
1270} while (0)
1271

◆ ShipScriptEventNoCx

#define ShipScriptEventNoCx ( ship,
event,
... )
Value:
do { \
jsval argv[] = { __VA_ARGS__ }; \
uintN argc = sizeof argv / sizeof *argv; \
[ship doScriptEvent:OOJSID(event) withArguments:argv count:argc]; \
} while (0)

Definition at line 1273 of file ShipEntity.h.

1273jsval argv[] = { __VA_ARGS__ }; \
1274uintN argc = sizeof argv / sizeof *argv; \
1275[ship doScriptEvent:OOJSID(event) withArguments:argv count:argc]; \
1276} while (0)
1277

◆ SUN_TEMPERATURE

#define SUN_TEMPERATURE   1250.0f

Definition at line 72 of file ShipEntity.h.

◆ TRACTOR_FORCE

#define TRACTOR_FORCE   2500.0f

Definition at line 92 of file ShipEntity.h.

◆ TURRET_MINIMUM_COS

#define TURRET_MINIMUM_COS   0.20f

Definition at line 42 of file ShipEntity.h.

◆ TURRET_SHOT_DURATION

#define TURRET_SHOT_DURATION   3.0

Definition at line 81 of file ShipEntity.h.

◆ TURRET_SHOT_FREQUENCY

#define TURRET_SHOT_FREQUENCY   (TURRET_SHOT_DURATION * TURRET_SHOT_DURATION * TURRET_SHOT_DURATION / 100.0)

Definition at line 83 of file ShipEntity.h.

◆ TURRET_SHOT_RANGE

#define TURRET_SHOT_RANGE   (TURRET_SHOT_SPEED * TURRET_SHOT_DURATION)

Definition at line 82 of file ShipEntity.h.

◆ TURRET_SHOT_SPEED

#define TURRET_SHOT_SPEED   2000.0f

Definition at line 80 of file ShipEntity.h.

◆ TURRET_TYPICAL_ENERGY

#define TURRET_TYPICAL_ENERGY   25.0f

Definition at line 79 of file ShipEntity.h.

◆ WEAPON_COOLING_CUTOUT

#define WEAPON_COOLING_CUTOUT   0.85f

Definition at line 116 of file ShipEntity.h.

◆ WEAPON_COOLING_FACTOR

#define WEAPON_COOLING_FACTOR   6.0f

Definition at line 114 of file ShipEntity.h.

Typedef Documentation

◆ OOBehaviour

typedef enum OOBehaviour OOBehaviour

◆ OOWeaponType

Definition at line 168 of file ShipEntity.h.

Enumeration Type Documentation

◆ OOAlertCondition

Enumerator
ALERT_CONDITION_DOCKED 
ALERT_CONDITION_GREEN 
ALERT_CONDITION_YELLOW 
ALERT_CONDITION_RED 

Definition at line 171 of file ShipEntity.h.

172{
173 // Alert conditions are used by player and station entities.
174 // NOTE: numerical values are available to scripts and shaders.
OOAlertCondition
Definition ShipEntity.h:172
@ ALERT_CONDITION_GREEN
Definition ShipEntity.h:176
@ ALERT_CONDITION_RED
Definition ShipEntity.h:178
@ ALERT_CONDITION_YELLOW
Definition ShipEntity.h:177
@ ALERT_CONDITION_DOCKED
Definition ShipEntity.h:175

◆ OOBehaviour

Definition at line 149 of file ShipEntity.h.

150{
151#include "OOBehaviour.tbl"
OOBehaviour
Definition ShipEntity.h:150

◆ OOShipDamageType

Enumerator
kOOShipDamageTypeDefault 

Definition at line 182 of file ShipEntity.h.

183{
184#define DIFF_STRING_ENTRY(label, string) label,
185#include "OOShipDamageType.tbl"
186#undef DIFF_STRING_ENTRY
187
188 kOOShipDamageTypeDefault = kOODamageTypeEnergy
OOShipDamageType
Definition ShipEntity.h:183
@ kOOShipDamageTypeDefault
Definition ShipEntity.h:188

Function Documentation

◆ getWeaponRangeFromType()

GLfloat getWeaponRangeFromType ( OOWeaponType weapon_type)

Definition at line 14948 of file ShipEntity.m.

14949{
14950 return [weapon_type weaponRange];
14951}

References OOEquipmentType::weaponRange.

+ Here is the call graph for this function:

◆ isWeaponNone()

BOOL isWeaponNone ( OOWeaponType weapon)

Definition at line 14954 of file ShipEntity.m.

14955{
14956 return weapon == nil || [[weapon identifier] isEqualToString:@"EQ_WEAPON_NONE"];
14957}
return nil

Referenced by ShipThreatAssessment(), and StationAddShipToShipyard().

+ Here is the caller graph for this function:

◆ OODefaultShipShaderMacros()

NSDictionary * OODefaultShipShaderMacros ( void )

Definition at line 14898 of file ShipEntity.m.

14899{
14900 static NSDictionary *macros = nil;
14901
14902 if (macros == nil)
14903 {
14904 macros = [[[ResourceManager materialDefaults] oo_dictionaryForKey:@"ship-prefix-macros" defaultValue:[NSDictionary dictionary]] retain];
14905 }
14906
14907 return macros;
14908}

References ResourceManager::materialDefaults, and nil.

+ Here is the call graph for this function:

◆ OODisplayStringFromAlertCondition()

NSString * OODisplayStringFromAlertCondition ( OOAlertCondition alertCondition)

Definition at line 460 of file OOConstToString.m.

461{
462 NSArray *conditionNames = [[UNIVERSE descriptions] oo_arrayForKey:@"condition"];
463 return [conditionNames oo_stringAtIndex:alertCondition];
464}
#define UNIVERSE
Definition Universe.h:833

◆ OOEquipmentIdentifierFromWeaponType()

NSString * OOEquipmentIdentifierFromWeaponType ( OOWeaponType weapon)

Definition at line 280 of file OOConstToString.m.

281{
282 return [weapon identifier];
283}

References OOEquipmentType::identifier.

+ Here is the call graph for this function:

◆ OOStringFromBehaviour()

NSString * OOStringFromBehaviour ( OOBehaviour behaviour)

Definition at line 51 of file OOConstToString.m.

52{
53 switch (value)
54 {
55 #include "OOBehaviour.tbl"
56 }
57
58 return @"** BEHAVIOUR UNKNOWN **";
59}

◆ OOStringFromShipDamageType()

NSString * OOStringFromShipDamageType ( OOShipDamageType type)

Definition at line 115 of file OOConstToString.m.

116{
117 switch (value)
118 {
119 #include "OOShipDamageType.tbl"
120 }
121
122 return @"UNDEFINED";
123}

◆ OOStringFromWeaponType()

NSString * OOStringFromWeaponType ( OOWeaponType weapon)

Definition at line 264 of file OOConstToString.m.

265{
266 if (weapon == nil) {
267 return @"EQ_WEAPON_NONE";
268 } else {
269 return [weapon identifier];
270 }
271}

References OOEquipmentType::identifier, and nil.

+ Here is the call graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierLegacy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierLegacy ( NSString * string)

Definition at line 307 of file OOConstToString.m.

308{
309 if ([string intValue] > 0)
310 {
311 switch ([string intValue])
312 {
313 case 2:
314 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_PULSE_LASER");
315 case 3:
316 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_BEAM_LASER");
317 case 4:
318 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MINING_LASER");
319 case 5:
320 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_MILITARY_LASER");
321 case 10:
322 return OOWeaponTypeFromEquipmentIdentifierSloppy(@"EQ_WEAPON_THARGOID_LASER");
323 default:
325 }
326 }
328}
OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy(NSString *string)

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierSloppy()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierSloppy ( NSString * string)

Definition at line 286 of file OOConstToString.m.

287{
288 OOWeaponType w = [OOEquipmentType equipmentTypeWithIdentifier:string];
289 if (w == nil)
290 {
291 if (![string hasPrefix:@"EQ_"])
292 {
293 w = [OOEquipmentType equipmentTypeWithIdentifier:[NSString stringWithFormat:@"EQ_%@",string]];
294 if (w != nil)
295 {
296 return w;
297 }
298 }
299 return [OOEquipmentType equipmentTypeWithIdentifier:@"EQ_WEAPON_NONE"];
300 }
301 return w;
302}

References OOEquipmentType::equipmentTypeWithIdentifier:, and nil.

Referenced by OOWeaponTypeFromEquipmentIdentifierLegacy(), OOWeaponTypeFromEquipmentIdentifierStrict(), OOWeaponTypeFromString(), and StationAddShipToShipyard().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OOWeaponTypeFromEquipmentIdentifierStrict()

OOWeaponType OOWeaponTypeFromEquipmentIdentifierStrict ( NSString * string)

Definition at line 331 of file OOConstToString.m.

332{
333 // there is no difference between the two any more
335}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function:

◆ OOWeaponTypeFromString()

OOWeaponType OOWeaponTypeFromString ( NSString * string)

Definition at line 274 of file OOConstToString.m.

275{
277}

References OOWeaponTypeFromEquipmentIdentifierSloppy().

+ Here is the call graph for this function: