mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-22 13:15:39 +08:00
Ref T296, adding scenery offset as situation member plus utility functions
* frontOrNull/backOrNull * added offset in model * style/renaming
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
|
||||
#include <tuple>
|
||||
|
||||
namespace BlackMisc
|
||||
@@ -24,5 +23,23 @@ namespace BlackMisc
|
||||
CAircraftSituationChangeList::CAircraftSituationChangeList(std::initializer_list<CAircraftSituationChange> il) :
|
||||
CSequence<CAircraftSituationChange>(il)
|
||||
{ }
|
||||
|
||||
CAircraftSituationChange CAircraftSituationChangeList::frontOrNull() const
|
||||
{
|
||||
if (this->isEmpty()) { return CAircraftSituationChange::null(); }
|
||||
return this->front();
|
||||
}
|
||||
|
||||
CAircraftSituationChange CAircraftSituationChangeList::backOrNull() const
|
||||
{
|
||||
if (this->isEmpty()) { return CAircraftSituationChange::null(); }
|
||||
return this->back();
|
||||
}
|
||||
|
||||
CAircraftSituationChange CAircraftSituationChangeList::indexOrNull(int index) const
|
||||
{
|
||||
if (this->size() > index) { return (*this)[index]; }
|
||||
return CAircraftSituationChange::null();
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user