summaryrefslogtreecommitdiff
path: root/src/engine/components/Highlight.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/components/Highlight.ts')
-rw-r--r--src/engine/components/Highlight.ts9
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);
}
}