Oolite 1.91.0.7659-250410-0031890
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
ProxyPlayerEntity.m
Go to the documentation of this file.
1/*
2
3ProxyPlayerEntity.m
4
5
6Oolite
7Copyright (C) 2004-2013 Giles C Williams and contributors
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22MA 02110-1301, USA.
23
24*/
25
26#import "ProxyPlayerEntity.h"
27
28
29@implementation ProxyPlayerEntity
30
31- (id)initWithKey:(NSString *)key definition:(NSDictionary *)dict
32{
33 self = [super initWithKey:key definition:dict];
34 if (self != nil)
35 {
36 [self setDialForwardShield:1.0f];
37 [self setDialAftShield:1.0f];
38 [self setDialFuelScoopStatus:[self hasScoop] ? SCOOP_STATUS_OKAY : SCOOP_STATUS_NOT_INSTALLED];
39 [self setCompassMode:[self hasEquipmentItemProviding:@"EQ_ADVANCED_COMPASS"] ? COMPASS_MODE_PLANET : COMPASS_MODE_BASIC];
40 [self setTradeInFactor:95];
41 }
42
43 return self;
44}
45
46
65
66
68{
69 return YES;
70}
71
72
73- (float) fuelLeakRate
74{
75 return _fuelLeakRate;
76}
77
78- (void) setFuelLeakRate:(float)value
79{
80 _fuelLeakRate = fmax(value, 0.0f);
81}
82
83
84- (BOOL) massLocked
85{
86 return _massLocked;
87}
88
89- (void) setMassLocked:(BOOL)value
90{
91 _massLocked = !!value;
92}
93
94
96{
97 return _atHyperspeed;
98}
99
100- (void) setAtHyperspeed:(BOOL)value
101{
102 _atHyperspeed = !!value;
103}
104
105
107{
108 return _dialForwardShield;
109}
110
111- (void) setDialForwardShield:(GLfloat)value
112{
113 _dialForwardShield = value;
114}
115
116
117- (GLfloat) dialAftShield
118{
119 return _dialAftShield;
120}
121
122- (void) setDialAftShield:(GLfloat)value
123{
124 _dialAftShield = value;
125}
126
127
132
133- (void) setDialMissileStatus:(OOMissileStatus)value
134{
135 _missileStatus = value;
136}
137
138
143
144- (void) setDialFuelScoopStatus:(OOFuelScoopStatus)value
145{
146 _fuelScoopStatus = value;
147}
148
149
151{
152 return _compassMode;
153}
154
155- (void) setCompassMode:(OOCompassMode)value
156{
157 _compassMode = value;
158}
159
160
162{
163 return _dialIdentEngaged;
164}
165
166- (void) setDialIdentEngaged:(BOOL)value
167{
168 _dialIdentEngaged = !!value;
169}
170
171
176
177- (void) setAlertCondition:(OOAlertCondition)value
178{
179 _alertCondition = value;
180}
181
182
183- (NSUInteger) trumbleCount
184{
185 return _trumbleCount;
186}
187
188
189- (void) setTrumbleCount:(NSUInteger)value
190{
191 _trumbleCount = value;
192}
193
194
195- (void) setTradeInFactor:(int)tif
196{
197 _tradeInFactor = tif;
198}
199
200
202{
203 return _tradeInFactor;
204}
205
206
207
208// If you're here to add more properties, don't forget to update -copyValuesFromPlayer:.
209
210@end
211
212
213@implementation Entity (ProxyPlayer)
214
216{
217 return NO;
218}
219
220@end
221
222
223@implementation PlayerEntity (ProxyPlayer)
224
226{
227 return YES;
228}
229
230@end
return nil
OOCompassMode
Definition OOTypes.h:145
OOFuelScoopStatus
OOMissileStatus
OOAlertCondition
Definition ShipEntity.h:172
BOOL dialIdentEngaged()
NSUInteger trumbleCount
GLfloat dialAftShield()
OOFuelScoopStatus dialFuelScoopStatus()
GLfloat dialForwardShield()
OOMissileStatus dialMissileStatus()
OOAlertCondition alertCondition
OOCompassMode compassMode
void setDialMissileStatus:(OOMissileStatus value)
void setDialForwardShield:(GLfloat value)
void setFuelLeakRate:(float value)
OOFuelScoopStatus dialFuelScoopStatus()
OOAlertCondition alertCondition()
OOCompassMode _compassMode
void setTrumbleCount:(NSUInteger value)
void setCompassMode:(OOCompassMode value)
void setAtHyperspeed:(BOOL value)
void setMassLocked:(BOOL value)
OOFuelScoopStatus _fuelScoopStatus
void setTradeInFactor:(int tif)
OOAlertCondition _alertCondition
OOMissileStatus _missileStatus
OOMissileStatus dialMissileStatus()
void setAlertCondition:(OOAlertCondition condition)
void setDialIdentEngaged:(BOOL value)
OOCompassMode compassMode()
void setDialFuelScoopStatus:(OOFuelScoopStatus value)
void setDialAftShield:(GLfloat value)
BOOL hasScoop()
id initWithKey:definition:(NSString *key,[definition] NSDictionary *dict)
Definition ShipEntity.m:193
BOOL hasEquipmentItemProviding:(NSString *equipmentType)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque