Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
#41 - Removed Debug and Lint Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CullieM committed Aug 25, 2021
1 parent 6b7f4e6 commit d1d8bef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/controllers/EditorController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class EditorController
console.log("Doing the jumps");
//if (currentObject.returnJumps.length !== 0)
//{
nodeView.receiveJumps(currentObject.returnJumps);
nodeView.receiveJumps(currentObject.returnJumps);

//}
break;
Expand Down
29 changes: 3 additions & 26 deletions src/views/ts/nodeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,23 +671,22 @@ export function addNode(node: YarnNode) : void
*/
export function receiveJumps(jumps: NodeJump[]) : void
{

//DESTROY ALL THE ARROWS
jumpMap.forEach(arrow =>
{
arrow.destroy();
});

//CLEAR THE MAP
jumpMap.clear();

//Required for when the below loop is not entered.
updateMiniMap();

//DRAW ALL THE NEW ARROWS
for (let i = 0; i < jumps.length ; i++)
{
connectNodes(jumps[i].getSource(), jumps[i].getTarget());
}
console.log("jumpMapLength HERE "+jumpMap.size); // ! DEBUG
console.log("jumps param length here HERE "+jumps.length);
/*
const oldJumps = Array.from(jumpMap.keys());
const newJumps = new Array<Array<number>>();
Expand Down Expand Up @@ -753,26 +752,4 @@ export function receiveJumps(jumps: NodeJump[]) : void
removeJump(deletedJump[0], deletedJump[1]);
});
*/

}

/**
* * Delete jumps
* Should just be:
* get([from,to]).destroy();
* delete([from,to]);
* @param {number} from The source node UID
* @param {number} to The target node UID
* @returns {void}
*/
function removeJump(from: number, to: number)
{
jumpMap.delete([from, to]);
jumpMap.forEach((value, key) =>
{
if(key[0] == from && key[1] == to)
{
value.destroy();
}
});
}

0 comments on commit d1d8bef

Please sign in to comment.