Skip to content

Commit

Permalink
Merge branch 'master' into 29-using-vitest-for-unit-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanR712 authored Oct 9, 2023
2 parents 4b26a2b + d2e1cdb commit 37415a9
Show file tree
Hide file tree
Showing 14 changed files with 505 additions and 175 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"Anusha",
"Huda",
"jamesoswald",
"mosueout",
"peaceiris",
"peircemyheart",
"radx",
Expand Down
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
},
"homepage": "https://github.com/James-Oswald/PeirceMyHeart#readme",
"devDependencies": {
"@types/node": "20.8.0",
"gts": "^5.0.1",
"typedoc": "^0.25.1",
"@types/node": "20.8.3",
"gts": "^5.2.0",
"typedoc": "^0.25.2",
"typescript": "~5.2.2",
"vite": "^4.4.9",
"vite": "^4.4.11",
"vitest": "^0.34.6"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions src/AEG/AEGTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export class AEGTree {
* @returns True, if the node can be inserted. Else, false
*/
public canInsert(incomingNode: AtomNode | CutNode): boolean {
console.log("checking can insert");
const currentCut: CutNode = this.sheet.getCurrentCut(incomingNode);
for (let i = 0; i < currentCut.children.length; i++) {
if (this.overlaps(incomingNode, currentCut.children[i])) {
Expand All @@ -87,8 +86,6 @@ export class AEGTree {
}

const currentCut: CutNode = this.sheet.getCurrentCut(incomingNode);
//const originalChildren: (AtomNode | CutNode)[] = currentCut.children;
//==============CHANGEDDDD=========
const originalChildren: (AtomNode | CutNode)[] = [...currentCut.children];
currentCut.children.push(incomingNode);

Expand Down
8 changes: 4 additions & 4 deletions src/AEG/AtomNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export class AtomNode {
* @param rect The rectangle to be set as the boundary box of this node.
* @param val The value of the proposition represented by this node.
*/
public constructor(val: string, origin: Point, rect: Rectangle) {
this.rect = rect;
this.identifier = val;
this.origin = origin;
public constructor(val?: string, origin?: Point, rect?: Rectangle) {
this.rect = rect ?? new Rectangle();
this.identifier = val ?? "";
this.origin = origin ?? new Point();
}

/**
Expand Down
3 changes: 0 additions & 3 deletions src/AEG/CutNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export class CutNode {
for (let i = 0; i < this.children.length; i++) {
const child: CutNode | AtomNode = this.children[i];
if (child instanceof CutNode && this.children[i].containsNode(newNode)) {
//======DEBUGGG=======
console.log("current cut: " + this.children[i]);
//newNode can be placed at least one layer deeper
return child.getCurrentCut(newNode);
}
Expand Down Expand Up @@ -77,7 +75,6 @@ export class CutNode {
if (otherNode instanceof AtomNode) {
return this.ellipse.containsShape(otherNode.rect);
} else if (otherNode instanceof CutNode) {
//ELLIPSE TO BE IMPLEMENTED ACCURATELY
return this.ellipse.containsShape(otherNode.ellipse as Ellipse);
} else {
throw Error("containsNode expected AtomNode or CutNode");
Expand Down
Loading

0 comments on commit 37415a9

Please sign in to comment.