Skip to content

Get rid of the dummies, and notice a few incorrect things #1229

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

Merged
merged 7 commits into from
Mar 6, 2017

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Mar 5, 2017

PileUp serialization should be nicer now.

@eggrobin
Copy link
Member Author

eggrobin commented Mar 5, 2017

Edited to ifdef out some serialization that called the old signature of Vessel::ReadFromMessage; please go back to not breaking the build of ksp_plugin, because now I need to build in order to work on the C♯.

Sorry, something went wrong.

PartId part_id,
GUID const& vessel_guid,
RelativeDegreesOfFreedom<AliceSun> const& from_parent) {
not_null<Vessel*> vessel = find_vessel_by_guid_or_die(vessel_guid).get();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

part_id,
1 * Kilogram,
vessel->parent()->current_degrees_of_freedom(current_time_) + relative);
not_null<Part*> part = vessel->part(part_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

PlanetariumRotation().Inverse()(from_parent);
ephemeris_->Prolong(current_time_);
AddPart(
vessel,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indent is weird, I'd prefer to move this to the previous line and split the last parameter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

std::map<PartId, not_null<Vessel*>>::iterator it;
bool emplaced;
std::tie(it, emplaced) = part_id_to_vessel_.emplace(part_id, vessel);
CHECK(emplaced);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Print the part_id and the vessel guid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the vessel guid.

bool emplaced;
std::tie(it, emplaced) = part_id_to_vessel_.emplace(part_id, vessel);
CHECK(emplaced);
auto deletion_callback = [ it, &map = part_id_to_vessel_ ] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No space before/after []

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done; clang-format does that when capturing an expression by reference somehow O_o

map.erase(it);
};
auto part =
make_not_null_unique<Part>(part_id,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would fit on the previous line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// For a KSP |Vessel| |v|, the arguments correspond to |v.id|,
// |v.orbit.referenceBody.flightGlobalsIndex|, |v.loaded|.
virtual void InsertOrKeepVessel(GUID const& vessel_guid,
Index parent_index,
bool loaded,
bool& inserted);

// Adds a part with the given part_id to the vessel with the given ID, which
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

|part_id|
ID->guid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -427,8 +429,15 @@ class Plugin {
physics::KeplerianElements<Barycentric>> const& keplerian_elements,
MassiveBody const& body);

void AddPart(not_null<Vessel*> vessel,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment: Adds a part to a vessel, recording it in the appropriate map and setting up a deletion callback.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// still parts left after the removals; thus a call to |AddParts| must occur
// before |FreeParts| is first called.
// since the last call to |FreePart|. Checks that there are still parts left
// after the removals; thus a call to |AddParts| must occur before |FreeParts|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddPart (no s)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -774,6 +774,19 @@ message InsertOrKeepLoadedPart {
optional In in = 1;
}

message InsertUnloadedPart {
extend Method {
optional InsertUnloadedPart extension = 5024;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invest in a new extension # to make sure that we don't confuse ourselves.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@pleroy pleroy added the LGTM label Mar 6, 2017
@eggrobin eggrobin merged commit 5a2afd6 into mockingbirdnest:Cardano Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants