From 1b6275b4fbc4ab7bcd876938f807aad9ce1900a6 Mon Sep 17 00:00:00 2001 From: nil Date: Fri, 13 Dec 2024 20:00:50 +0100 Subject: add liberties --- src/engine/vector2.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/engine/vector2.js') diff --git a/src/engine/vector2.js b/src/engine/vector2.js index 6c2a2a2..8b10e28 100644 --- a/src/engine/vector2.js +++ b/src/engine/vector2.js @@ -5,9 +5,20 @@ export class Vector2 { } static sum(a, b) { - return new Vector2( - a.x + b.x, - a.y + b.y, - ) + return new Vector2( + a.x + b.x, + a.y + b.y, + ) + } + + static equals(a, b) { + if ( + a.x == b.x && + a.y == b.y + ) { + return true + } + + return false } } -- cgit v1.2.3