From 92780a26cd8f4411d4b34d28b127ac1cb3d01be6 Mon Sep 17 00:00:00 2001 From: RichaGadgil Date: Sun, 28 Feb 2021 14:11:52 -0800 Subject: [PATCH 1/3] initial ideas for overlay refactor --- src/modules/Objects/Interaction.ts | 21 +++++++++++++++++++++ src/modules/Objects/Overlay.ts | 6 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 src/modules/Objects/Interaction.ts diff --git a/src/modules/Objects/Interaction.ts b/src/modules/Objects/Interaction.ts new file mode 100644 index 0000000..1adbd83 --- /dev/null +++ b/src/modules/Objects/Interaction.ts @@ -0,0 +1,21 @@ +export class TeleportInteraction { + interactionType: string; + locationId: number; + information: string; + + constructor(locationId: number, information: string) { + this.interactionType = "TELEPORT"; + this.locationId = locationId; + this.information = information; + } +} + +export class InformationInteraction { + interactionType: string; + information: string; + + constructor(information: string) { + this.interactionType = "SHOWINFO"; + this.information = information; + } +} diff --git a/src/modules/Objects/Overlay.ts b/src/modules/Objects/Overlay.ts index 738cadd..7110286 100644 --- a/src/modules/Objects/Overlay.ts +++ b/src/modules/Objects/Overlay.ts @@ -1,16 +1,16 @@ import { OverlayType } from "./OverlayType"; +import { TeleportInteraction, InformationInteraction } from "./Interaction"; export class Overlay { overlayId: number; - overlayType: typeof OverlayType; + overlayType: typeof TeleportInteraction | typeof InformationInteraction; title: string; description: string; parent: number; position: number[]; args: object; - constructor( overlayId: number, - overlayType: typeof OverlayType, + overlayType: typeof TeleportInteraction | typeof InformationInteraction, title: string, description: string, parent: number, From 0fb2f15b00ced177dac461995f15ed26dec97cad Mon Sep 17 00:00:00 2001 From: RichaGadgil Date: Sun, 28 Feb 2021 14:30:01 -0800 Subject: [PATCH 2/3] functions? --- src/modules/Objects/Interaction.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/modules/Objects/Interaction.ts b/src/modules/Objects/Interaction.ts index 1adbd83..2db2823 100644 --- a/src/modules/Objects/Interaction.ts +++ b/src/modules/Objects/Interaction.ts @@ -8,14 +8,22 @@ export class TeleportInteraction { this.locationId = locationId; this.information = information; } + + teleport() { + // ? + } } export class InformationInteraction { interactionType: string; - information: string; + resourceURL: string; - constructor(information: string) { + constructor(resourceURL: string) { this.interactionType = "SHOWINFO"; - this.information = information; + this.resourceURL = resourceURL; + } + + getInfo() { + // add API Information Here } } From bfedc3fcd7a28f58a05a4f202924056cc5208fe8 Mon Sep 17 00:00:00 2001 From: RichaGadgil Date: Sun, 28 Feb 2021 15:04:15 -0800 Subject: [PATCH 3/3] nvm --- src/modules/Objects/Interaction.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/modules/Objects/Interaction.ts b/src/modules/Objects/Interaction.ts index 2db2823..34e4707 100644 --- a/src/modules/Objects/Interaction.ts +++ b/src/modules/Objects/Interaction.ts @@ -8,10 +8,6 @@ export class TeleportInteraction { this.locationId = locationId; this.information = information; } - - teleport() { - // ? - } } export class InformationInteraction { @@ -22,8 +18,4 @@ export class InformationInteraction { this.interactionType = "SHOWINFO"; this.resourceURL = resourceURL; } - - getInfo() { - // add API Information Here - } }