Oolite 1.91.0.7645-241119-222d325
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 3712 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_MIN

#define VELOCITY_CLEANUP_MIN   2000.0f

Definition at line 3711 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_RATE

#define VELOCITY_CLEANUP_RATE   0.001f

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

13700{
13701 OOCommodityMarket *market = (OOCommodityMarket *)context;
13702 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
13703 if (result < 0)
13704 {
13705 return NSOrderedAscending;
13706 }
13707 else if (result > 0)
13708 {
13709 return NSOrderedDescending;
13710 }
13711 else
13712 {
13713 return NSOrderedSame;
13714 }
13715}
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 13654 of file PlayerEntity.m.

13655{
13656 OOCommodityMarket *market = (OOCommodityMarket *)context;
13657 return [[market nameForGood:(OOCommodityType)a] compare:[market nameForGood:(OOCommodityType)b]];
13658}
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 13661 of file PlayerEntity.m.

13662{
13663 OOCommodityMarket *market = (OOCommodityMarket *)context;
13664 int result = (int)[market priceForGood:(OOCommodityType)a] - (int)[market priceForGood:(OOCommodityType)b];
13665 if (result < 0)
13666 {
13667 return NSOrderedAscending;
13668 }
13669 else if (result > 0)
13670 {
13671 return NSOrderedDescending;
13672 }
13673 else
13674 {
13675 return NSOrderedSame;
13676 }
13677}

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

13681{
13682 OOCommodityMarket *market = (OOCommodityMarket *)context;
13683 int result = (int)[market quantityForGood:(OOCommodityType)a] - (int)[market quantityForGood:(OOCommodityType)b];
13684 if (result < 0)
13685 {
13686 return NSOrderedAscending;
13687 }
13688 else if (result > 0)
13689 {
13690 return NSOrderedDescending;
13691 }
13692 else
13693 {
13694 return NSOrderedSame;
13695 }
13696}

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

Referenced by PlayerEntity::activateSelectedInterface.

◆ sBaseMass

GLfloat sBaseMass = 0.0
static

Definition at line 105 of file PlayerEntity.m.