From f0c2b45d6befb3a44c45951519c3241637cfb53c Mon Sep 17 00:00:00 2001 From: joni <johnfshaughnessy@gmail.com> Date: Wed, 23 May 2018 18:29:48 -0700 Subject: [PATCH] Remove duplicate file. --- src/utils/PrimaryActionHandler.js | 51 ------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/utils/PrimaryActionHandler.js diff --git a/src/utils/PrimaryActionHandler.js b/src/utils/PrimaryActionHandler.js deleted file mode 100644 index b838d005d..000000000 --- a/src/utils/PrimaryActionHandler.js +++ /dev/null @@ -1,51 +0,0 @@ -export default class PrimaryActionHandler { - constructor(scene) { - this.cursor = null; - this.handledByCursor = false; - this.handledByTeleport = false; - - this.rightTeleporter = null; - this.leftTeleporter = null; - this.scene = scene; - - this.registerCursor = this.registerCursor.bind(this); - this.isReady = this.isReady.bind(this); - this.addEventListeners = this.addEventListeners.bind(this); - this.onPrimaryDown = this.onPrimaryDown.bind(this); - this.onPrimaryUp = this.onPrimaryUp.bind(this); - } - - registerCursor(cursor) { - this.cursor = cursor; - if (this.isReady()) { - this.addEventListeners(); - } - } - - isReady() { - return this.cursor; // && this.rightTeleporter && this.leftTeleporter; - } - - addEventListeners() { - this.scene.addEventListener("action_primary_down", this.onPrimaryDown); - this.scene.addEventListener("action_primary_up", this.onPrimaryUp); - } - - onPrimaryDown(e) { - this.handledByCursor = this.cursor.beginInteraction(); - if (this.handledByCursor) return; - // Do teleport things. - console.log(e); - if (e.components["teleport-controls"]) { - console.log("yes"); - } - console.log("no"); - } - - onPrimaryUp(e) { - if (this.handledByCursor) { - this.cursor.endInteraction(); - return; - } - } -} -- GitLab