19using namespace swift::misc::aviation;
20using namespace swift::misc::geo;
21using namespace swift::misc::physical_quantities;
22using namespace swift::misc::network;
26namespace swift::misc::simulation
63 if (!aircraft.isPartsSynchronized())
74 if (this->
isEmpty())
return false;
92 aircraftToBeUpdated.
setIcaoCodes(aircraftIcao, airlineIcao);
100 if (!aircraft.isRendered())
104 aircraft.setRendered(
false);
113 if (aircraft.getCallsign() != callsign)
117 aircraft.setRendered(rendered);
119 if (onlyFirst)
break;
129 if (aircraft.getCallsign() != callsign)
135 if (onlyFirst)
break;
145 if (aircraft.getCallsign() != callsign)
149 aircraft.setFastPositionUpdates(fastPositions);
151 if (onlyFirst)
break;
161 if (aircraft.getCallsign() != callsign)
165 aircraft.setEnabled(enabled);
167 if (onlyFirst)
break;
177 if (aircraft.getCallsign() != callsign)
181 aircraft.setModel(model);
183 if (onlyFirst)
break;
194 if (aircraft.getCallsign() != callsign)
198 aircraft.setParts(parts);
199 aircraft.setPartsSynchronized(
true);
201 if (onlyFirst)
break;
212 if (aircraft.getCallsign() != callsign)
216 aircraft.setSituation(situation);
217 if (onlyFirst)
break;
228 if (aircraft.getCallsign() != callsign)
232 aircraft.setGroundElevationChecked(elevation, info);
234 if (onlyFirst)
break;
243 if (aircraft.getCallsign() != callsign)
247 return aircraft.isEnabled();
256 if (aircraft.getCallsign() != callsign)
260 return aircraft.isRendered();
287 if (aircraft.isEnabled())
300 if (aircraft.isRendered())
313 if (aircraft.isPartsSynchronized())
iterator push_back(const T &value)
Synonym for insert.
auto transform(F function) const
Return a new container generated by applying some transformation function to all elements of this one...
int replaceIf(Predicate p, const CSimulatedAircraft &replacement)
CSequence findBy(Predicate p) const
void push_back(const CSimulatedAircraft &value)
Value object for ICAO classification.
void updateMissingParts(const CAircraftIcaoCode &otherIcaoCode)
Update missing parts.
Value object encapsulating information of aircraft's parts.
Value object encapsulating information of an aircraft's situation.
GndElevationInfo
Where did we get elevation from?
Value object for ICAO classification.
void updateMissingParts(const CAirlineIcaoCode &otherIcaoCode)
Update missing parts.
Value object encapsulating information of a callsign.
bool isEmpty() const
Is empty?
Value object for a set of callsigns.
CSimulatedAircraft findFirstByCallsign(const CCallsign &callsign, const CSimulatedAircraft &ifNotFound={}) const
bool containsCallsign(const CCallsign &callsign) const
Plane of same elevation, can be a single point or larger area (e.g. airport).
const physical_quantities::CLength & getRelativeDistance() const
Get the distance.
Value object encapsulating information of a user.
void updateMissingParts(const CUser &otherUser)
Update missing parts in this object.
Value object encapsulating a list of voice rooms.
Physical unit length (length).
Aircraft model (used by another pilot, my models on disk).
Value object encapsulating a list of aircraft models.
Comprehensive information of an aircraft.
bool hasRealName() const
Has valid realname?
bool isRendered() const
Rendered?
const aviation::CCallsign & getCallsign() const
Get callsign.
const aviation::CAircraftIcaoCode & getAircraftIcaoCode() const
Get aircraft ICAO info.
bool hasAircraftAndAirlineDesignator() const
Valid designators?
const network::CUser & getPilot() const
Get user.
bool hasId() const
Has valid id?
bool isEnabled() const
Enabled? Enable means it shall be displayed in the simulator.
bool isVtol() const
VTOL aircraft?
bool setIcaoCodes(const aviation::CAircraftIcaoCode &aircraftIcaoCode, const aviation::CAirlineIcaoCode &airlineIcaoCode)
Set ICAO info.
const simulation::CAircraftModel & getModel() const
Get model (model used for mapping).
QString getCallsignAsString() const
Get callsign.
const aviation::CAirlineIcaoCode & getAirlineIcaoCode() const
Airline ICAO code if any.
void setPilot(const network::CUser &user)
Set pilot.
int countRendered() const
Number of rendered aircraft.
bool updateWithVatsimDataFileData(CSimulatedAircraft &aircraftToBeUpdated) const
Update aircraft with data from VATSIM data file.
int setAircraftSituation(const aviation::CCallsign &callsign, const aviation::CAircraftSituation &situation, bool onlyFirst=true)
Set aircraft situation.
network::CUserList getPilots() const
All pilots (with valid data).
CSequence()=default
Default constructor.
int setCG(const aviation::CCallsign &callsign, const physical_quantities::CLength &cg, bool onlyFirst=true)
Set center of gravity.
CSimulatedAircraftList()=default
Default constructor.
Q_REQUIRED_RESULT CSimulatedAircraftList findByRendered(bool rendered) const
Rendered / not rendered aircraft.
int setAircraftPartsSynchronized(const aviation::CCallsign &callsign, const aviation::CAircraftParts &parts, bool onlyFirst=true)
Set aircraft parts and mark as synchronized.
int countEnabled() const
Number of enabled aircraft.
aviation::CCallsignSet getCallsignsWithSynchronizedParts() const
Callsigns of aircraft with synchronized parts.
Q_REQUIRED_RESULT CSimulatedAircraftList findByEnabled(bool enabled) const
Enabled / disabled aircraft.
bool replaceOrAddByCallsign(const CSimulatedAircraft &aircraft)
Replace or add by callsign.
int setEnabled(const aviation::CCallsign &callsign, bool enabled, bool onlyFirst)
Mark given callsign as enabled.
bool isRendered(const aviation::CCallsign &callsign) const
Rendered?
CAircraftModelList getModels() const
Get all models.
bool isEnabled(const aviation::CCallsign &callsign) const
Enabled?
void sortByDistanceToReferencePositionRenderedCallsign()
Same as sortByDistanceToReferencePosition, but consider callsign and rendered as secondary criteria.
int setAircraftModel(const aviation::CCallsign &callsign, const CAircraftModel &model, bool onlyFirst=true)
Set model.
CSimulatedAircraftList findByVtol(bool vtol) const
VTOL / non VTOL aircraft.
int countAircraftPartsSynchronized() const
Number of aircraft with parts.
int setFastPositionUpdates(const aviation::CCallsign &callsign, bool fastPositions, bool onlyFirst=true)
Mark as fast position enabled.
int setGroundElevationChecked(const aviation::CCallsign &callsign, const geo::CElevationPlane &elevation, aviation::CAircraftSituation::GndElevationInfo info, bool onlyFirst=true)
Set ground elevation.
void markAllAsNotRendered()
Mark all aircraft as unrendered.
int setRendered(const aviation::CCallsign &callsign, bool rendered, bool onlyFirst=true)
Mark given callsign as rendered.
auto MemberTransform(T memberFunc)
Returns a function object that returns the value returned by one of it's argument member functions.
auto MemberValid(T memberFunc)
Returns a predicate that returns true if the isValid() method of the value returned from one of its m...
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.