diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-02 01:07:55 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-02 01:07:55 -0700 |
commit | 1ec5a8d088f599d094f387abc6014f228607b605 (patch) | |
tree | 0d0e0271b6d5db354a56337c5de9df1a933e767b /src/engine/components/Interactable.ts | |
parent | a333ce8845de4269d6a6f5523d2273da11fe271c (diff) | |
download | the-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.ts | 15 |
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(); + } +} |