Oolite 1.91.0.7604-240417-a536cbe
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
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)   do { updateStage = (x); } while (0)
 
#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)   if (x) { [flags addObject:@#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)    if (x) { [flags addObject:@#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)    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 13690 of file PlayerEntity.m.

13691{
13692 OOCommodityMarket *market = (OOCommodityMarket *)context;
13693 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
13694 if (result < 0)
13695 {
13696 return NSOrderedAscending;
13697 }
13698 else if (result > 0)
13699 {
13700 return NSOrderedDescending;
13701 }
13702 else
13703 {
13704 return NSOrderedSame;
13705 }
13706}
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 13645 of file PlayerEntity.m.

13646{
13647 OOCommodityMarket *market = (OOCommodityMarket *)context;
13648 return [[market nameForGood:(OOCommodityType)a] compare:[market nameForGood:(OOCommodityType)b]];
13649}
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 13652 of file PlayerEntity.m.

13653{
13654 OOCommodityMarket *market = (OOCommodityMarket *)context;
13655 int result = (int)[market priceForGood:(OOCommodityType)a] - (int)[market priceForGood:(OOCommodityType)b];
13656 if (result < 0)
13657 {
13658 return NSOrderedAscending;
13659 }
13660 else if (result > 0)
13661 {
13662 return NSOrderedDescending;
13663 }
13664 else
13665 {
13666 return NSOrderedSame;
13667 }
13668}

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

13672{
13673 OOCommodityMarket *market = (OOCommodityMarket *)context;
13674 int result = (int)[market quantityForGood:(OOCommodityType)a] - (int)[market quantityForGood:(OOCommodityType)b];
13675 if (result < 0)
13676 {
13677 return NSOrderedAscending;
13678 }
13679 else if (result > 0)
13680 {
13681 return NSOrderedDescending;
13682 }
13683 else
13684 {
13685 return NSOrderedSame;
13686 }
13687}

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

Referenced by PlayerEntity::activateSelectedInterface.

◆ sBaseMass

GLfloat sBaseMass = 0.0
static

Definition at line 105 of file PlayerEntity.m.