diff options
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(); + } +} |