Oolite
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)   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 2605 of file PlayerEntity.m.

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

◆ UPDATE_STAGE

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

Definition at line 2615 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_FULL

#define VELOCITY_CLEANUP_FULL   5000.0f

Definition at line 3742 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_MIN

#define VELOCITY_CLEANUP_MIN   2000.0f

Definition at line 3741 of file PlayerEntity.m.

◆ VELOCITY_CLEANUP_RATE

#define VELOCITY_CLEANUP_RATE   0.001f

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

13728{
13729 OOCommodityMarket *market = (OOCommodityMarket *)context;
13730 int result = (int)[market massUnitForGood:(OOCommodityType)a] - (int)[market massUnitForGood:(OOCommodityType)b];
13731 if (result < 0)
13732 {
13733 return NSOrderedAscending;
13734 }
13735 else if (result > 0)
13736 {
13737 return NSOrderedDescending;
13738 }
13739 else
13740 {
13741 return NSOrderedSame;
13742 }
13743}
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 13682 of file PlayerEntity.m.

13683{
13684 OOCommodityMarket *market = (OOCommodityMarket *)context;
13685 return [[market nameForGood:(OOCommodityType)a] compare:[market nameForGood:(OOCommodityType)b]];
13686}
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 13689 of file PlayerEntity.m.

13690{
13691 OOCommodityMarket *market = (OOCommodityMarket *)context;
13692 int result = (int)[market priceForGood:(OOCommodityType)a] - (int)[market priceForGood:(OOCommodityType)b];
13693 if (result < 0)
13694 {
13695 return NSOrderedAscending;
13696 }
13697 else if (result > 0)
13698 {
13699 return NSOrderedDescending;
13700 }
13701 else
13702 {
13703 return NSOrderedSame;
13704 }
13705}

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

13709{
13710 OOCommodityMarket *market = (OOCommodityMarket *)context;
13711 int result = (int)[market quantityForGood:(OOCommodityType)a] - (int)[market quantityForGood:(OOCommodityType)b];
13712 if (result < 0)
13713 {
13714 return NSOrderedAscending;
13715 }
13716 else if (result > 0)
13717 {
13718 return NSOrderedDescending;
13719 }
13720 else
13721 {
13722 return NSOrderedSame;
13723 }
13724}

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

Referenced by PlayerEntity::activateSelectedInterface.

◆ sBaseMass

GLfloat sBaseMass = 0.0
static

Definition at line 105 of file PlayerEntity.m.