phaser/src/geom/line/Equals.js

29 lines
706 B
JavaScript
Raw Normal View History

2018-02-12 16:01:20 +00:00
/**
* @author Richard Davey <rich@photonstorm.com>
2022-02-28 14:29:51 +00:00
* @copyright 2022 Photon Storm Ltd.
2019-05-10 15:15:04 +00:00
* @license {@link https://opensource.org/licenses/MIT|MIT License}
2018-02-12 16:01:20 +00:00
*/
2017-10-13 13:11:54 +00:00
/**
* Compare two lines for strict equality.
2017-10-13 13:11:54 +00:00
*
* @function Phaser.Geom.Line.Equals
* @since 3.0.0
*
* @param {Phaser.Geom.Line} line - The first line to compare.
* @param {Phaser.Geom.Line} toCompare - The second line to compare.
2017-10-13 13:11:54 +00:00
*
* @return {boolean} Whether the two lines are equal.
2017-10-13 13:11:54 +00:00
*/
var Equals = function (line, toCompare)
{
return (
line.x1 === toCompare.x1 &&
line.y1 === toCompare.y1 &&
line.x2 === toCompare.x2 &&
line.y2 === toCompare.y2
);
};
module.exports = Equals;