-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the current orbit on the analyser button #2802
Conversation
@@ -1060,6 +1060,14 @@ not_null<Vessel*> Plugin::GetVessel(GUID const& vessel_guid) const { | |||
return FindOrDie(vessels_, vessel_guid).get(); | |||
} | |||
|
|||
void Plugin::ClearOrbitAnalysersOfVesselsOtherThan(Vessel const& vessel) { | |||
for (auto const& [guid, v] : vessels_) { | |||
if (v.get() != &vessel) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not depend on pointers: guid != vessel.guid()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is precedent for that, e.g.,
Principia/ksp_plugin/plugin.cpp
Lines 476 to 477 in d74f564
not_null<Vessel*> const current_vessel = associated_vessel; | |
if (vessel == current_vessel) { |
and it is safe since
Vessel
is neither copiable nor movable.
@@ -378,6 +378,9 @@ class Plugin { | |||
virtual bool HasVessel(GUID const& vessel_guid) const; | |||
virtual not_null<Vessel*> GetVessel(GUID const& vessel_guid) const; | |||
|
|||
virtual void ClearOrbitAnalysersOfVesselsOtherThan( | |||
Vessel const& vessel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fits on previous line?
Examples:


