Oolite
Loading...
Searching...
No Matches
PlayerEntity.m File Reference
#include <assert.h>
import "PlayerEntity.h"
import "PlayerEntityContracts.h"
import "PlayerEntityControls.h"
import "PlayerEntityLegacyScriptEngine.h"
import "PlayerEntityScriptMethods.h"
import "PlayerEntitySound.h"
import "OOLaserShotEntity.h"
import "OOMesh.h"
import "OOPlanetEntity.h"
import "OOQuiriumCascadeEntity.h"
import "OOSunEntity.h"
import "ProxyPlayerEntity.h"
import "StationEntity.h"
import "WormholeEntity.h"
import "AI.h"
import "GameController.h"
import "HeadUpDisplay.h"
import "MyOpenGLView.h"
import "NSFileManagerOOExtensions.h"
import "OOCacheManager.h"
import "OOCollectionExtractors.h"
import "OOColor.h"
import "OOConstToString.h"
import "OODebugSupport.h"
import "OOEntityFilterPredicate.h"
import "OOEquipmentType.h"
import "OOFullScreenController.h"
import "OOMaths.h"
import "OOMusicController.h"
import "OOOXZManager.h"
import "OOOpenGLExtensionManager.h"
import "OOPListParsing.h"
import "OORoleSet.h"
import "OOShipRegistry.h"
import "OOSound.h"
import "OOStringExpander.h"
import "OOStringParsing.h"
import "OOTexture.h"
import "OOTrumble.h"
import "Octree.h"
import "PlayerEntityLoadSave.h"
import "ResourceManager.h"
import "ShipEntityAI.h"
import "Universe.h"
import "CollisionRegion.h"
import "OOConstToJSString.h"
import "OOJSEngineTimeManagement.h"
import "OOJSGuiScreenKeyDefinition.h"
import "OOJSInterfaceDefinition.h"
import "OOJSScript.h"
import "OOScriptTimer.h"
import "OOJoystickManager.h"
import "OOSystemDescriptionManager.h"
import "PlayerEntityKeyMapper.h"
import "PlayerEntityStickMapper.h"
import "PlayerEntityStickProfile.h"
Include dependency graph for PlayerEntity.m:

Go to the source code of this file.

Classes

category  PlayerEntity(OOPrivate)
category  ShipEntity(Hax)

Macros

#define PLAYER_DEFAULT_NAME   @"Jameson"
#define STAGE_TRACKING_BEGIN
#define STAGE_TRACKING_END
#define UPDATE_STAGE(x)
#define VELOCITY_CLEANUP_MIN   2000.0f
#define VELOCITY_CLEANUP_FULL   5000.0f
#define VELOCITY_CLEANUP_RATE   0.001f
#define OO_SETACCESSCONDITIONFORROW(condition, row)

Enumerations

enum  { kCommLogTrimThreshold = 15U , kCommLogTrimSize = 10U }

Functions

NSComparisonResult marketSorterByName (id a, id b, void *market)
NSComparisonResult marketSorterByPrice (id a, id b, void *market)
NSComparisonResult marketSorterByQuantity (id a, id b, void *market)
NSComparisonResult marketSorterByMassUnit (id a, id b, void *market)

Variables

static NSString *const kOOLogBuyMountedOK = @"equip.buy.mounted"
static NSString *const kOOLogBuyMountedFailed = @"equip.buy.mounted.failed"
static float const kDeadResetTime = 30.0f
PlayerEntity * gOOPlayer = nil
static GLfloat sBaseMass = 0.0
static NSString * last_outfitting_key = nil

Macro Definition Documentation

◆ OO_SETACCESSCONDITIONFORROW

#define OO_SETACCESSCONDITIONFORROW ( condition,
row )
Value:
do { \
if ((condition)) { \
[gui setKey:GUI_KEY_OK forRow:(row)]; \
} else { \
[gui setColor:[OOColor grayColor] forRow:(row)]; \
} \
} while (0)
#define OO_SETACCESSCONDITIONFORROW(condition, row)
OOColor * grayColor()
Definition OOColor.m:254

Referenced by PlayerEntity::setGuiToGameOptionsScreen.

◆ PLAYER_DEFAULT_NAME

#define PLAYER_DEFAULT_NAME   @"Jameson"

Definition at line 89 of file PlayerEntity.m.

◆ STAGE_TRACKING_BEGIN

#define STAGE_TRACKING_BEGIN
Value:
{ \
NSString* volatile updateStage = @"initialisation"; \
@try {

Definition at line 2355 of file PlayerEntity.m.

2355#define STAGE_TRACKING_BEGIN \
2356 { \
2357 NSString* volatile updateStage = @"initialisation"; \
2358 @try {

Referenced by PlayerEntity::doBookkeeping:, PlayerEntity(OOPrivate)::performInFlightUpdates:, PlayerEntity(OOPrivate)::performWitchspaceCountdownUpdates:, PlayerEntity::update:, and PlayerEntity(OOPrivate)::updateTargeting.

◆ STAGE_TRACKING_END

#define STAGE_TRACKING_END
Value:
} \
@catch (NSException * exception) \
{ \
OOLog(kOOLogException, @"***** Exception during [%@] in %s : %@ : %@ *****", updateStage, __PRETTY_FUNCTION__, [exception name], [exception reason]); \
@throw exception; \
} \
}
NSString *const kOOLogException
Definition OOLogging.m:600

Definition at line 2359 of file PlayerEntity.m.

2359#define STAGE_TRACKING_END \
2360 } \
2361 @catch (NSException * exception) \
2362 { \
2363 OOLog(kOOLogException, @"***** Exception during [%@] in %s : %@ : %@ *****", updateStage, __PRETTY_FUNCTION__, [exception name], [exception reason]); \
2364 @throw exception; \
2365 } \
2366 }

Referenced by PlayerEntity::doBookkeeping:, PlayerEntity(OOPrivate)::performInFlightUpdates:, PlayerEntity(OOPrivate)::performWitchspaceCountdownUpdates:, PlayerEntity::update:, and PlayerEntity(OOPrivate)::updateTargeting.

◆ UPDATE_STAGE

#define UPDATE_STAGE ( x)
Value:
do { \
updateStage = (x); \
} while (0)
float x

Definition at line 2367 of file PlayerEntity.m.

2367#define UPDATE_STAGE(x) \
2368 do { \
2369 updateStage = (x); \
2370 } while (0)

Referenced by PlayerEntity::doBookkeeping:, PlayerEntity(OOPrivate)::performInFlightUpdates:, PlayerEntity(OOPrivate)::performWitchspaceCountdownUpdates:, PlayerEntity::update:, and PlayerEntity(OOPrivate)::updateTargeting.

◆ VELOCITY_CLEANUP_FULL

#define VELOCITY_CLEANUP_FULL   5000.0f

Definition at line 3347 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

◆ VELOCITY_CLEANUP_MIN

#define VELOCITY_CLEANUP_MIN   2000.0f

Definition at line 3346 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

◆ VELOCITY_CLEANUP_RATE

#define VELOCITY_CLEANUP_RATE   0.001f

Definition at line 3348 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kCommLogTrimThreshold 
kCommLogTrimSize 

Definition at line 91 of file PlayerEntity.m.

91 {
92 // If comm log is kCommLogTrimThreshold or more lines long, it will be cut to kCommLogTrimSize.
95};
@ kCommLogTrimSize
@ kCommLogTrimThreshold

Function Documentation

◆ marketSorterByMassUnit()

NSComparisonResult marketSorterByMassUnit ( id a,
id b,
void * market )

Definition at line 11904 of file PlayerEntity.m.

11905{
11906 OOCommodityMarket* market = (OOCommodityMarket*)context;
11907 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
11908 if (result < 0) {
11909 return NSOrderedAscending;
11910 } else if (result > 0) {
11911 return NSOrderedDescending;
11912 } else {
11913 return NSOrderedSame;
11914 }
11915}
NSString * OOCommodityType
Definition OOTypes.h:97
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

References int(), and OOCommodityMarket::massUnitForGood:.

Here is the call graph for this function:

◆ marketSorterByName()

NSComparisonResult marketSorterByName ( id a,
id b,
void * market )

Definition at line 11872 of file PlayerEntity.m.

11873{
11874 OOCommodityMarket* market = (OOCommodityMarket*)context;
11875 return [[market nameForGood:(OOCommodityType)a] compare:[market nameForGood:(OOCommodityType)b]];
11876}
NSString * nameForGood:(OOCommodityType good)

References OOCommodityMarket::nameForGood:.

Here is the call graph for this function:

◆ marketSorterByPrice()

NSComparisonResult marketSorterByPrice ( id a,
id b,
void * market )

Definition at line 11878 of file PlayerEntity.m.

11879{
11880 OOCommodityMarket* market = (OOCommodityMarket*)context;
11881 int result = (int)[market priceForGood:(OOCommodityType)a] - (int)[market priceForGood:(OOCommodityType)b];
11882 if (result < 0) {
11883 return NSOrderedAscending;
11884 } else if (result > 0) {
11885 return NSOrderedDescending;
11886 } else {
11887 return NSOrderedSame;
11888 }
11889}

References int(), and OOCommodityMarket::priceForGood:.

Here is the call graph for this function:

◆ marketSorterByQuantity()

NSComparisonResult marketSorterByQuantity ( id a,
id b,
void * market )

Definition at line 11891 of file PlayerEntity.m.

11892{
11893 OOCommodityMarket* market = (OOCommodityMarket*)context;
11894 int result = (int)[market quantityForGood:(OOCommodityType)a] - (int)[market quantityForGood:(OOCommodityType)b];
11895 if (result < 0) {
11896 return NSOrderedAscending;
11897 } else if (result > 0) {
11898 return NSOrderedDescending;
11899 } else {
11900 return NSOrderedSame;
11901 }
11902}

References int(), and OOCommodityMarket::quantityForGood:.

Here is the call graph for this function:

Variable Documentation

◆ gOOPlayer

◆ kDeadResetTime

float const kDeadResetTime = 30.0f
static

◆ kOOLogBuyMountedFailed

NSString* const kOOLogBuyMountedFailed = @"equip.buy.mounted.failed"
static

Definition at line 98 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::tryBuyingItem:.

◆ kOOLogBuyMountedOK

NSString* const kOOLogBuyMountedOK = @"equip.buy.mounted"
static

Definition at line 97 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::tryBuyingItem:.

◆ last_outfitting_key

NSString* last_outfitting_key = nil
static

◆ sBaseMass

GLfloat sBaseMass = 0.0
static

Definition at line 102 of file PlayerEntity.m.

Referenced by PlayerEntity::baseMass.