Skip to content

Commit

Permalink
Switch order of parameters in Ray.Deconstruct (MonoGame#6198)
Browse files Browse the repository at this point in the history
* Switch order of parameters in Ray.Deconstruct

The parameters in the type deconstructors should match the order of the parameters in the constructors.

* Fixed Ray.Deconstruct test.
  • Loading branch information
KonajuGames authored and dellis1972 committed Feb 21, 2018
1 parent 48c08d0 commit 46f90ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions MonoGame.Framework/Ray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ public override string ToString()
/// <summary>
/// Deconstruction method for <see cref="Ray"/>.
/// </summary>
/// <param name="direction"></param>
/// <param name="position"></param>
public void Deconstruct(out Vector3 direction, out Vector3 position)
/// <param name="position">Receives the start position of the ray.</param>
/// <param name="direction">Receives the direction of the ray.</param>
public void Deconstruct(out Vector3 position, out Vector3 direction)
{
direction = Direction;
position = Position;
direction = Direction;
}

#endregion
Expand Down
6 changes: 3 additions & 3 deletions Test/Framework/RayTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public void Deconstruct()
{
Ray ray = new Ray(Vector3.Backward, Vector3.Right);

Vector3 direction, position;
Vector3 position, direction;

ray.Deconstruct(out direction, out position);
ray.Deconstruct(out position, out direction);

Assert.AreEqual(direction, ray.Direction);
Assert.AreEqual(position, ray.Position);
Assert.AreEqual(direction, ray.Direction);
}
}
}

0 comments on commit 46f90ee

Please sign in to comment.