summaryrefslogtreecommitdiff
path: root/src/engine/components/Interactable.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-02 01:07:55 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-03-02 01:07:55 -0700
commit1ec5a8d088f599d094f387abc6014f228607b605 (patch)
tree0d0e0271b6d5db354a56337c5de9df1a933e767b /src/engine/components/Interactable.ts
parenta333ce8845de4269d6a6f5523d2273da11fe271c (diff)
downloadthe-abstraction-engine-1ec5a8d088f599d094f387abc6014f228607b605.tar.gz
the-abstraction-engine-1ec5a8d088f599d094f387abc6014f228607b605.zip
add interactable component
Diffstat (limited to 'src/engine/components/Interactable.ts')
-rw-r--r--src/engine/components/Interactable.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/engine/components/Interactable.ts b/src/engine/components/Interactable.ts
new file mode 100644
index 0000000..2937596
--- /dev/null
+++ b/src/engine/components/Interactable.ts
@@ -0,0 +1,15 @@
+import { Component, ComponentNames } from ".";
+
+export class Interactable extends Component {
+ private interaction: Function;
+
+ constructor(interaction: Function) {
+ super(ComponentNames.Interactable);
+
+ this.interaction = interaction;
+ }
+
+ public interact() {
+ this.interaction();
+ }
+}