Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
PlayerEntityContracts.h
Go to the documentation of this file.
1/*
2
3PlayerEntityContracts.h
4
5Methods relating to passenger and cargo contract handling.
6
7Oolite
8Copyright (C) 2004-2013 Giles C Williams and contributors
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23MA 02110-1301, USA.
24
25*/
26
27#import "PlayerEntity.h"
29#import "GuiDisplayGen.h"
30
31#define PASSENGER_KEY_NAME @"name"
32
33#define CARGO_KEY_ID @"id"
34#define CARGO_KEY_TYPE @"co_type"
35#define CARGO_KEY_AMOUNT @"co_amount"
36#define CARGO_KEY_DESCRIPTION @"cargo_description"
37
38#define CONTRACT_KEY_START @"start"
39#define CONTRACT_KEY_DESTINATION @"destination"
40#define CONTRACT_KEY_DESTINATION_NAME @"destination_name"
41#define CONTRACT_KEY_LONG_DESCRIPTION @"long_description"
42#define CONTRACT_KEY_DEPARTURE_TIME @"departure_time"
43#define CONTRACT_KEY_ARRIVAL_TIME @"arrival_time"
44#define CONTRACT_KEY_FEE @"fee"
45#define CONTRACT_KEY_PREMIUM @"premium"
46#define CONTRACT_KEY_RISK @"risk"
47
48#define MAX_CONTRACT_REP 70
49
50#define GUI_ROW_PASSENGERS_LABELS 1
51#define GUI_ROW_PASSENGERS_START 2
52#define GUI_ROW_CARGO_LABELS 8
53#define GUI_ROW_CARGO_START 9
54#define GUI_ROW_CONTRACT_INFO_START 15
55
56#define GUI_ROW_SHIPYARD_LABELS 1
57#define GUI_ROW_SHIPYARD_START 2
58#define GUI_ROW_SHIPYARD_INFO_START 15
59#define GUI_ROW_NO_SHIPS 10
60
61#define MAX_ROWS_SHIPS_FOR_SALE 12
62
63@interface PlayerEntity (Contracts)
64
65- (NSString *) processEscapePods; // removes pods from cargo bay and treats categories of characters carried
66- (NSString *) checkPassengerContracts; // returns messages from any passengers whose status have changed
67
68- (NSDictionary *) reputation;
69
71- (void) increasePassengerReputation:(unsigned)amount;
72- (void) decreasePassengerReputation:(unsigned)amount;
73
75- (void) increaseParcelReputation:(unsigned)amount;
76- (void) decreaseParcelReputation:(unsigned)amount;
77
79- (void) increaseContractReputation:(unsigned)amount;
80- (void) decreaseContractReputation:(unsigned)amount;
81- (OOCargoQuantity) contractedVolumeForGood:(OOCommodityType) good;
82
83- (void) erodeReputation;
84- (void) normaliseReputation;
85
86- (void) addMessageToReport:(NSString*) report;
87
88// - (void) setGuiToContractsScreen;
89//- (BOOL) pickFromGuiContractsScreen;
90//- (void) highlightSystemFromGuiContractsScreen;
91
92- (BOOL) addPassenger:(NSString*)Name start:(unsigned)start destination:(unsigned)destination eta:(double)eta fee:(double)fee advance:(double)advance risk:(unsigned)risk; // for js scripting
93- (BOOL) removePassenger:(NSString*)Name; // for js scripting
94- (BOOL) addParcel:(NSString*)Name start:(unsigned)start destination:(unsigned)destination eta:(double)eta fee:(double)fee premium:(double)premium risk:(unsigned)risk; // for js scripting
95- (BOOL) removeParcel:(NSString*)Name; // for js scripting
96- (BOOL) awardContract:(unsigned)qty commodity:(NSString*)commodity start:(unsigned)start destination:(unsigned)destination eta:(double)eta fee:(double)fee premium:(double)premium; // for js scripting.
97- (BOOL) removeContract:(NSString*)commodity destination:(unsigned)destination; // for js scripting
98
99- (NSArray *) passengerList;
100- (NSArray *) parcelList;
101- (NSArray *) contractList;
103- (void) setManifestScreenRow:(id)object inColor:(OOColor*)color forRow:(OOGUIRow)row ofRows:(OOGUIRow)max_rows andOffset:(OOGUIRow)offset inMultipage:(BOOL)multi;
104
105
107
108// ---------------------------------------------------------------------- //
109
110- (void) setGuiToShipyardScreen:(NSUInteger)skip;
111
112- (void) showShipyardModel:(NSString *)shipKey shipData:(NSDictionary *)shipDict personality:(uint16_t)personality;
114- (NSInteger) missingSubEntitiesAdjustment;
116
117- (OOCreditsQuantity) priceForShipKey:(NSString *)key;
118- (BOOL) buySelectedShip;
119- (BOOL) replaceShipWithNamedShip:(NSString *)shipName;
120- (void) newShipCommonSetup:(NSString *)shipKey yardInfo:(NSDictionary *)ship_info baseInfo:(NSDictionary *)ship_base_dict;
121
122@end
NSInteger OOGUIRow
NSString * OOCommodityType
Definition OOTypes.h:106
uint64_t OOCreditsQuantity
Definition OOTypes.h:182
uint32_t OOCargoQuantity
Definition OOTypes.h:176
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque