diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-02 04:02:20 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-02 04:02:20 -0700 |
commit | 4b9349b3f8bee21eb086cfd6e7668532a50e6048 (patch) | |
tree | fa3ae95f516d8ec10fb0de57886ff88410b6d11d /src/engine/components/Highlight.ts | |
parent | 06bb4177202b432d5f42141975ec82b5a8837f0e (diff) | |
download | the-abstraction-engine-4b9349b3f8bee21eb086cfd6e7668532a50e6048.tar.gz the-abstraction-engine-4b9349b3f8bee21eb086cfd6e7668532a50e6048.zip |
add text on lambda factory
Diffstat (limited to 'src/engine/components/Highlight.ts')
-rw-r--r-- | src/engine/components/Highlight.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine/components/Highlight.ts b/src/engine/components/Highlight.ts index 5875057..66ec74b 100644 --- a/src/engine/components/Highlight.ts +++ b/src/engine/components/Highlight.ts @@ -1,4 +1,5 @@ import { Component, ComponentNames } from "."; +import { Direction } from "../interfaces"; export class Highlight extends Component { public isHighlighted: boolean; @@ -6,8 +7,8 @@ export class Highlight extends Component { private onUnhighlight: Function; constructor( - onHighlight: Function, - onUnhighlight: Function, + onHighlight: (direction: Direction) => void, + onUnhighlight: () => void, isHighlighted: boolean = false, ) { super(ComponentNames.Highlight); @@ -17,10 +18,10 @@ export class Highlight extends Component { this.onUnhighlight = onUnhighlight; } - public highlight() { + public highlight(direction: Direction) { if (!this.isHighlighted) { this.isHighlighted = true; - this.onHighlight(); + this.onHighlight(direction); } } |