Oolite 1.91.0.7658-250404-b1488af
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
PlayerEntity.m File Reference
#include <assert.h>
import "PlayerEntity.h"
import "PlayerEntityLegacyScriptEngine.h"
import "PlayerEntityContracts.h"
import "PlayerEntityControls.h"
import "PlayerEntitySound.h"
import "PlayerEntityScriptMethods.h"
import "StationEntity.h"
import "OOSunEntity.h"
import "OOPlanetEntity.h"
import "WormholeEntity.h"
import "ProxyPlayerEntity.h"
import "OOQuiriumCascadeEntity.h"
import "OOLaserShotEntity.h"
import "OOMesh.h"
import "OOMaths.h"
import "GameController.h"
import "ResourceManager.h"
import "Universe.h"
import "AI.h"
import "ShipEntityAI.h"
import "MyOpenGLView.h"
import "OOTrumble.h"
import "PlayerEntityLoadSave.h"
import "OOSound.h"
import "OOColor.h"
import "Octree.h"
import "OOCacheManager.h"
import "OOOXZManager.h"
import "OOStringExpander.h"
import "OOStringParsing.h"
import "OOPListParsing.h"
import "OOCollectionExtractors.h"
import "OOConstToString.h"
import "OOTexture.h"
import "OORoleSet.h"
import "HeadUpDisplay.h"
import "OOOpenGLExtensionManager.h"
import "OOMusicController.h"
import "OOEntityFilterPredicate.h"
import "OOShipRegistry.h"
import "OOEquipmentType.h"
import "NSFileManagerOOExtensions.h"
import "OOFullScreenController.h"
import "OODebugSupport.h"
import "CollisionRegion.h"
import "OOJSScript.h"
import "OOScriptTimer.h"
import "OOJSEngineTimeManagement.h"
import "OOJSInterfaceDefinition.h"
import "OOJSGuiScreenKeyDefinition.h"
import "OOConstToJSString.h"
import "OOJoystickManager.h"
import "PlayerEntityStickMapper.h"
import "PlayerEntityStickProfile.h"
import "PlayerEntityKeyMapper.h"
import "OOSystemDescriptionManager.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)
 
#define ADD_FLAG_IF_SET(x)
 

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
 
PlayerEntitygOOPlayer = nil
 
static GLfloat sBaseMass = 0.0
 
static NSString * last_outfitting_key =nil
 

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)

◆ 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:262

Referenced by PlayerEntity::setGuiToGameOptionsScreen.

◆ PLAYER_DEFAULT_NAME

#define PLAYER_DEFAULT_NAME   @"Jameson"

Definition at line 90 of file PlayerEntity.m.

◆ STAGE_TRACKING_BEGIN

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

Definition at line 2603 of file PlayerEntity.m.

2603#define STAGE_TRACKING_BEGIN { \
2604 NSString * volatile updateStage = @"initialisation"; \
2605 @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:651

Definition at line 2606 of file PlayerEntity.m.

2606#define STAGE_TRACKING_END } \
2607 @catch (NSException *exception) \
2608 { \
2609 OOLog(kOOLogException, @"***** Exception during [%@] in %s : %@ : %@ *****", updateStage, __PRETTY_FUNCTION__, [exception name], [exception reason]); \
2610 @throw exception; \
2611 } \
2612 }

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

◆ UPDATE_STAGE

◆ VELOCITY_CLEANUP_FULL

#define VELOCITY_CLEANUP_FULL   5000.0f

Definition at line 3740 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

◆ VELOCITY_CLEANUP_MIN

#define VELOCITY_CLEANUP_MIN   2000.0f

Definition at line 3739 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

◆ VELOCITY_CLEANUP_RATE

#define VELOCITY_CLEANUP_RATE   0.001f

Definition at line 3741 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::performInFlightUpdates:.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kCommLogTrimThreshold 
kCommLogTrimSize 

Definition at line 92 of file PlayerEntity.m.

93{
94 // If comm log is kCommLogTrimThreshold or more lines long, it will be cut to kCommLogTrimSize.
97};
@ kCommLogTrimSize
@ kCommLogTrimThreshold

Function Documentation

◆ marketSorterByMassUnit()

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

Definition at line 13739 of file PlayerEntity.m.

13740{
13741 OOCommodityMarket *market = (OOCommodityMarket *)context;
13742 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
13743 if (result < 0)
13744 {
13745 return NSOrderedAscending;
13746 }
13747 else if (result > 0)
13748 {
13749 return NSOrderedDescending;
13750 }
13751 else
13752 {
13753 return NSOrderedSame;
13754 }
13755}
NSString * OOCommodityType
Definition OOTypes.h:106
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 13694 of file PlayerEntity.m.

13695{
13696 OOCommodityMarket *market = (OOCommodityMarket *)context;
13697 return [[market nameForGood:(OOCommodityType)a] compare:[market nameForGood:(OOCommodityType)b]];
13698}
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 13701 of file PlayerEntity.m.

13702{
13703 OOCommodityMarket *market = (OOCommodityMarket *)context;
13704 int result = (int)[market priceForGood:(OOCommodityType)a] - (int)[market priceForGood:(OOCommodityType)b];
13705 if (result < 0)
13706 {
13707 return NSOrderedAscending;
13708 }
13709 else if (result > 0)
13710 {
13711 return NSOrderedDescending;
13712 }
13713 else
13714 {
13715 return NSOrderedSame;
13716 }
13717}

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 13720 of file PlayerEntity.m.

13721{
13722 OOCommodityMarket *market = (OOCommodityMarket *)context;
13723 int result = (int)[market quantityForGood:(OOCommodityType)a] - (int)[market quantityForGood:(OOCommodityType)b];
13724 if (result < 0)
13725 {
13726 return NSOrderedAscending;
13727 }
13728 else if (result > 0)
13729 {
13730 return NSOrderedDescending;
13731 }
13732 else
13733 {
13734 return NSOrderedSame;
13735 }
13736}

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 101 of file PlayerEntity.m.

Referenced by PlayerEntity(OOPrivate)::tryBuyingItem:.

◆ kOOLogBuyMountedOK

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

Definition at line 100 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 105 of file PlayerEntity.m.

Referenced by PlayerEntity::baseMass.