Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
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

◆ 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)
OOColor * grayColor()
Definition OOColor.m:262

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

2600#define STAGE_TRACKING_BEGIN { \
2601 NSString * volatile updateStage = @"initialisation"; \
2602 @try {

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

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

◆ UPDATE_STAGE

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

Definition at line 2610 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_FULL

#define VELOCITY_CLEANUP_FULL   5000.0f

Definition at line 3737 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_MIN

#define VELOCITY_CLEANUP_MIN   2000.0f

Definition at line 3736 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_RATE

#define VELOCITY_CLEANUP_RATE   0.001f

Definition at line 3738 of file PlayerEntity.m.

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

13736{
13737 OOCommodityMarket *market = (OOCommodityMarket *)context;
13738 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
13739 if (result < 0)
13740 {
13741 return NSOrderedAscending;
13742 }
13743 else if (result > 0)
13744 {
13745 return NSOrderedDescending;
13746 }
13747 else
13748 {
13749 return NSOrderedSame;
13750 }
13751}
NSString * OOCommodityType
Definition OOTypes.h:106
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

◆ marketSorterByName()

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

Definition at line 13690 of file PlayerEntity.m.

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

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

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

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

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

+ Here is the call graph for this function:

Variable Documentation

◆ gOOPlayer

PlayerEntity* gOOPlayer = nil

Definition at line 104 of file PlayerEntity.m.

Referenced by OOGetPlayer().

◆ kDeadResetTime

float const kDeadResetTime = 30.0f
static

Definition at line 102 of file PlayerEntity.m.

◆ kOOLogBuyMountedFailed

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

Definition at line 101 of file PlayerEntity.m.

◆ kOOLogBuyMountedOK

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

Definition at line 100 of file PlayerEntity.m.

◆ last_outfitting_key

NSString* last_outfitting_key =nil
static

Definition at line 9247 of file PlayerEntity.m.

Referenced by PlayerEntity::activateSelectedInterface.

◆ sBaseMass

GLfloat sBaseMass = 0.0
static

Definition at line 105 of file PlayerEntity.m.