Oolite 1.91.0.7650-250121-affa790
Loading...
Searching...
No Matches
ShipEntity.m File Reference
import "ShipEntity.h"
import "ShipEntityAI.h"
import "ShipEntityScriptMethods.h"
import "OOMaths.h"
import "Universe.h"
import "OOShaderMaterial.h"
import "OOOpenGLExtensionManager.h"
import "ResourceManager.h"
import "OOStringExpander.h"
import "OOStringParsing.h"
import "OOCollectionExtractors.h"
import "OOConstToString.h"
import "OOConstToJSString.h"
import "NSScannerOOExtensions.h"
import "OOFilteringEnumerator.h"
import "OORoleSet.h"
import "OOShipGroup.h"
import "OOExcludeObjectEnumerator.h"
import "OOWeakSet.h"
import "GameController.h"
import "MyOpenGLView.h"
import "OOSystemDescriptionManager.h"
import "OOCharacter.h"
import "AI.h"
import "OOMesh.h"
import "OOPlanetDrawable.h"
import "Octree.h"
import "OOColor.h"
import "OOPolygonSprite.h"
import "OOParticleSystem.h"
import "StationEntity.h"
import "DockEntity.h"
import "OOSunEntity.h"
import "OOPlanetEntity.h"
import "PlanetEntity.h"
import "PlayerEntity.h"
import "WormholeEntity.h"
import "OOFlasherEntity.h"
import "OOExhaustPlumeEntity.h"
import "OOSparkEntity.h"
import "OOECMBlastEntity.h"
import "OOPlasmaShotEntity.h"
import "OOFlashEffectEntity.h"
import "OOExplosionCloudEntity.h"
import "ProxyPlayerEntity.h"
import "OOLaserShotEntity.h"
import "OOQuiriumCascadeEntity.h"
import "OORingEffectEntity.h"
import "PlayerEntityLegacyScriptEngine.h"
import "PlayerEntitySound.h"
import "GuiDisplayGen.h"
import "HeadUpDisplay.h"
import "OOEntityFilterPredicate.h"
import "OOShipRegistry.h"
import "OOEquipmentType.h"
import "OODebugGLDrawing.h"
import "OODebugFlags.h"
import "OODebugStandards.h"
import "OOJSScript.h"
import "OOJSVector.h"
import "OOJSEngineTimeManagement.h"
+ Include dependency graph for ShipEntity.m:

Go to the source code of this file.

Classes

category  ShipEntity(Private)
 

Macros

#define USEMASC   1
 
#define kBoulderRole   (@"boulder")
 
#define MAKE_VECTOR_ARRAY(v)
 
#define ADD_FLAG_IF_SET(x)
 

Functions

static ShipEntitydoOctreesCollide (ShipEntity *prime, ShipEntity *other)
 
NSDictionary * OODefaultShipShaderMacros (void)
 
BOOL OOUniformBindingPermitted (NSString *propertyName, id bindingTarget)
 
GLfloat getWeaponRangeFromType (OOWeaponType weapon_type)
 
BOOL isWeaponNone (OOWeaponType weapon)
 

Variables

static NSString *const kOOLogSyntaxAddShips = @"script.debug.syntax.addShips"
 
static NSString *const kOOLogEntityBehaviourChanged = @"entity.behaviour.changed"
 
static GLfloat cargo_color [4] = { 0.9, 0.9, 0.9, 1.0}
 
static GLfloat hostile_color [4] = { 1.0, 0.25, 0.0, 1.0}
 
static GLfloat neutral_color [4] = { 1.0, 1.0, 0.0, 1.0}
 
static GLfloat friendly_color [4] = { 0.0, 1.0, 0.0, 1.0}
 
static GLfloat missile_color [4] = { 0.0, 1.0, 1.0, 1.0}
 
static GLfloat police_color1 [4] = { 0.5, 0.0, 1.0, 1.0}
 
static GLfloat police_color2 [4] = { 1.0, 0.0, 0.5, 1.0}
 
static GLfloat jammed_color [4] = { 0.0, 0.0, 0.0, 0.0}
 
static GLfloat mascem_color1 [4] = { 0.3, 0.3, 0.3, 1.0}
 
static GLfloat mascem_color2 [4] = { 0.4, 0.1, 0.4, 1.0}
 
static GLfloat scripted_color [4] = { 0.0, 0.0, 0.0, 0.0}
 

Macro Definition Documentation

◆ ADD_FLAG_IF_SET

#define ADD_FLAG_IF_SET ( x)
Value:
if (x) { [flags addObject:@#x]; }
float x
#define ADD_FLAG_IF_SET(x)

◆ kBoulderRole

#define kBoulderRole   (@"boulder")

Definition at line 1657 of file ShipEntity.m.

◆ MAKE_VECTOR_ARRAY

#define MAKE_VECTOR_ARRAY ( v)
Value:
[[[OONativeVector alloc] initWithVector:v] autorelease]
#define MAKE_VECTOR_ARRAY(v)

Definition at line 1999 of file ShipEntity.m.

◆ USEMASC

#define USEMASC   1

Definition at line 96 of file ShipEntity.m.

Function Documentation

◆ doOctreesCollide()

static ShipEntity * doOctreesCollide ( ShipEntity * prime,
ShipEntity * other )
static

Referenced by ShipEntity::checkCloseCollisionWith:, and ShipEntity::doOctreesCollide.

+ Here is the caller graph for this function:

◆ getWeaponRangeFromType()

GLfloat getWeaponRangeFromType ( OOWeaponType weapon_type)

Definition at line 14948 of file ShipEntity.m.

14949{
14950 return [weapon_type weaponRange];
14951}

References OOEquipmentType::weaponRange.

Referenced by ShipEntity::behaviour_attack_broadside_target:leftside:, ShipEntity::behaviour_attack_target:, and ShipEntity::setWeaponDataFromType:.

+ Here is the call graph for this function:
+ Here is the caller 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

References OOEquipmentType::identifier, and nil.

Referenced by ShipEntity::behaviour_attack_broadside:, ShipEntity::behaviour_attack_broadside_target:leftside:, ShipEntity::behaviour_attack_fly_to_target:, ShipEntity::behaviour_attack_target:, ShipEntity::behaviour_close_to_broadside_range:, PlayerEntity::equipmentList, PlayerEntity::fireMainWeapon, ShipEntity::fireMainWeapon:, ShipEntity::fireSubentityLaserShot:, ShipEntity::fireWeapon:direction:range:, ShipEntity::hasOneEquipmentItem:includeWeapons:whileLoading:, ShipEntity::laserHeatLevelForward, PlayerEntity::setGuiToEquipShipScreen:selectingFacingFor:, Universe::shipsForSaleForSystem:withTL:atTime:, ShipThreatAssessment(), StationAddShipToShipyard(), and ShipEntity::weaponTypeIDForFacing:strict:.

+ Here is the call graph for this function:
+ 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:

◆ OOUniformBindingPermitted()

BOOL OOUniformBindingPermitted ( NSString * propertyName,
id bindingTarget )

Definition at line 14911 of file ShipEntity.m.

14912{
14913 static NSSet *entityWhitelist = nil;
14914 static NSSet *shipWhitelist = nil;
14915 static NSSet *playerShipWhitelist = nil;
14916 static NSSet *visualEffectWhitelist = nil;
14917
14918 if (entityWhitelist == nil)
14919 {
14920 NSDictionary *wlDict = [ResourceManager whitelistDictionary];
14921 entityWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_entity_binding_methods"]];
14922 shipWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_ship_binding_methods"]];
14923 playerShipWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_player_ship_binding_methods"]];
14924 visualEffectWhitelist = [[NSSet alloc] initWithArray:[wlDict oo_arrayForKey:@"shader_visual_effect_binding_methods"]];
14925 }
14926
14927 if ([bindingTarget isKindOfClass:[Entity class]])
14928 {
14929 if ([entityWhitelist containsObject:propertyName]) return YES;
14930 if ([bindingTarget isShip])
14931 {
14932 if ([shipWhitelist containsObject:propertyName]) return YES;
14933 }
14934 if ([bindingTarget isPlayerLikeShip])
14935 {
14936 if ([playerShipWhitelist containsObject:propertyName]) return YES;
14937 }
14938 if ([bindingTarget isVisualEffect])
14939 {
14940 if ([visualEffectWhitelist containsObject:propertyName]) return YES;
14941 }
14942 }
14943
14944 return NO;
14945}

References nil, and ResourceManager::whitelistDictionary.

+ Here is the call graph for this function:

Variable Documentation

◆ cargo_color

GLfloat cargo_color[4] = { 0.9, 0.9, 0.9, 1.0}
static

◆ friendly_color

GLfloat friendly_color[4] = { 0.0, 1.0, 0.0, 1.0}
static

◆ hostile_color

GLfloat hostile_color[4] = { 1.0, 0.25, 0.0, 1.0}
static

◆ jammed_color

GLfloat jammed_color[4] = { 0.0, 0.0, 0.0, 0.0}
static

◆ kOOLogEntityBehaviourChanged

NSString* const kOOLogEntityBehaviourChanged = @"entity.behaviour.changed"
static

Definition at line 101 of file ShipEntity.m.

Referenced by ShipEntity::update:.

◆ kOOLogSyntaxAddShips

NSString* const kOOLogSyntaxAddShips = @"script.debug.syntax.addShips"
static

Definition at line 99 of file ShipEntity.m.

◆ mascem_color1

GLfloat mascem_color1[4] = { 0.3, 0.3, 0.3, 1.0}
static

◆ mascem_color2

GLfloat mascem_color2[4] = { 0.4, 0.1, 0.4, 1.0}
static

◆ missile_color

GLfloat missile_color[4] = { 0.0, 1.0, 1.0, 1.0}
static

◆ neutral_color

GLfloat neutral_color[4] = { 1.0, 1.0, 0.0, 1.0}
static

◆ police_color1

GLfloat police_color1[4] = { 0.5, 0.0, 1.0, 1.0}
static

◆ police_color2

GLfloat police_color2[4] = { 1.0, 0.0, 0.5, 1.0}
static

◆ scripted_color

GLfloat scripted_color[4] = { 0.0, 0.0, 0.0, 0.0}
static

Definition at line 6496 of file ShipEntity.m.

6496{ 0.0, 0.0, 0.0, 0.0}; // to be defined by script