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

Naval units (RepairableNear) units repaired with Repair cursor #12361 #13104

Merged
merged 1 commit into from Apr 24, 2017

Conversation

Projects
None yet
4 participants
@rob-v
Contributor

rob-v commented Apr 11, 2017

Repair cursor now supports also RepairableNear units - ships, submarines - in addition to Repairable vehicles.

@rob-v rob-v changed the title from RepairableNearUnitsWithRepairCursor #12361 to Naval units (RepairableNear) units repaired with Repair cursor #12361 Apr 11, 2017

@rob-v rob-v referenced this pull request Apr 11, 2017

Closed

Repair Submarines #12361

.OrderBy(p => (self.Location - p.Actor.Location).LengthSquared);
// Worst case FirstOrDefault() will return a TraitPair<null, null>, which is OK.
return repairBuilding.FirstOrDefault().Actor;

This comment has been minimized.

@Phrohdoh

Phrohdoh Apr 11, 2017

Member

Unless I am missing something if the query returns an empty collection FirstOrDefault will return null, not a TraitPair<null, null>.

@Phrohdoh

Phrohdoh Apr 11, 2017

Member

Unless I am missing something if the query returns an empty collection FirstOrDefault will return null, not a TraitPair<null, null>.

This comment has been minimized.

@rob-v

rob-v Apr 11, 2017

Contributor

I didn't check this, it is adapted copy from Repairable.FindRepairBuilding(). It contains this comment. Should I check it or can we assume it is correct?

@rob-v

rob-v Apr 11, 2017

Contributor

I didn't check this, it is adapted copy from Repairable.FindRepairBuilding(). It contains this comment. Should I check it or can we assume it is correct?

This comment has been minimized.

@rob-v

rob-v Apr 11, 2017

Contributor

repairBuilding is IOrderedEnumerable of TraitPair-s what is Struct, so FirstOrDefault() will never return null, only Actor can be null in such case like the comment says.

@rob-v

rob-v Apr 11, 2017

Contributor

repairBuilding is IOrderedEnumerable of TraitPair-s what is Struct, so FirstOrDefault() will never return null, only Actor can be null in such case like the comment says.

@rob-v

This comment has been minimized.

Show comment
Hide comment
@rob-v

rob-v Apr 11, 2017

Contributor

Style fixed.
Note: the function RepairableNear.FindRepairBuilding is like already used/tested function Repairable.FindRepairBuilding.

Contributor

rob-v commented Apr 11, 2017

Style fixed.
Note: the function RepairableNear.FindRepairBuilding is like already used/tested function Repairable.FindRepairBuilding.

@pchote

pchote approved these changes Apr 22, 2017

@pchote pchote added the PR: Needs +2 label Apr 22, 2017

@atlimit8 atlimit8 merged commit 99f3f37 into OpenRA:bleed Apr 24, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@atlimit8

This comment has been minimized.

Show comment
Hide comment
@atlimit8
Member

atlimit8 commented Apr 24, 2017

@rob-v rob-v deleted the rob-v:RepairNavalUnitsWithRepairCursor branch Apr 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment