Oolite
Loading...
Searching...
No Matches
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@implementation ProxyPlayerEntity
29
30- (id)initWithKey:(NSString*)key definition:(NSDictionary*)dict
31{
32 self = [super initWithKey:key definition:dict];
33 if (self != nil) {
34 [self setDialForwardShield:1.0f];
35 [self setDialAftShield:1.0f];
36 [self setDialFuelScoopStatus:[self hasScoop] ? SCOOP_STATUS_OKAY : SCOOP_STATUS_NOT_INSTALLED];
37 [self setCompassMode:[self hasEquipmentItemProviding:@"EQ_ADVANCED_COMPASS"] ? COMPASS_MODE_PLANET : COMPASS_MODE_BASIC];
38 [self setTradeInFactor:95];
39 }
40
41 return self;
42}
43
62
64{
65 return YES;
66}
67
69{
70 return _fuelLeakRate;
71}
72
73- (void)setFuelLeakRate:(float)value
74{
75 _fuelLeakRate = fmax(value, 0.0f);
76}
77
79{
80 return _massLocked;
81}
82
83- (void)setMassLocked:(BOOL)value
84{
85 _massLocked = !!value;
86}
87
89{
90 return _atHyperspeed;
91}
92
93- (void)setAtHyperspeed:(BOOL)value
94{
95 _atHyperspeed = !!value;
96}
97
99{
100 return _dialForwardShield;
101}
102
103- (void)setDialForwardShield:(GLfloat)value
104{
105 _dialForwardShield = value;
106}
107
109{
110 return _dialAftShield;
111}
112
113- (void)setDialAftShield:(GLfloat)value
114{
115 _dialAftShield = value;
116}
117
122
123- (void)setDialMissileStatus:(OOMissileStatus)value
124{
125 _missileStatus = value;
126}
127
132
133- (void)setDialFuelScoopStatus:(OOFuelScoopStatus)value
134{
135 _fuelScoopStatus = value;
136}
137
139{
140 return _compassMode;
141}
142
143- (void)setCompassMode:(OOCompassMode)value
144{
145 _compassMode = value;
146}
147
149{
150 return _dialIdentEngaged;
151}
152
153- (void)setDialIdentEngaged:(BOOL)value
154{
155 _dialIdentEngaged = !!value;
156}
157
162
163- (void)setAlertCondition:(OOAlertCondition)value
164{
165 _alertCondition = value;
166}
167
168- (NSUInteger)trumbleCount
169{
170 return _trumbleCount;
171}
172
173- (void)setTrumbleCount:(NSUInteger)value
174{
175 _trumbleCount = value;
176}
177
178- (void)setTradeInFactor:(int)tif
179{
180 _tradeInFactor = tif;
181}
182
184{
185 return _tradeInFactor;
186}
187
188// If you're here to add more properties, don't forget to update -copyValuesFromPlayer:.
189
190@end
191
192@implementation Entity (ProxyPlayer)
193
195{
196 return NO;
197}
198
199@end
200
201@implementation PlayerEntity (ProxyPlayer)
202
204{
205 return YES;
206}
207
208@end
return nil
OOCompassMode
Definition OOTypes.h:129
OOFuelScoopStatus
OOMissileStatus
OOAlertCondition
Definition ShipEntity.h:166
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:190
BOOL hasEquipmentItemProviding:(NSString *equipmentType)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque