Created
May 8, 2020 15:19
-
-
Save confraria/2cc58338a884eb985bed7728906a8b88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private addStep(step) { | |
step.id = `scriptStep${this.stepId++}`; | |
this.ctxQuest.lastStep = step; | |
this.ctxQuest.steps.push(step); | |
step.quest = this.ctxQuest; | |
if (this.state !== 'directC' && step.type === DIRECT_COMMUNICATION_SEND_DIRECT_MESSAGE) { | |
this.state = 'directC'; | |
} | |
if (this.state === 'directC' && ![DIRECT_COMMUNICATION_SEND_DIRECT_MESSAGE, ADD_DECISION].includes(step.type)) { | |
this.state = undefined; | |
this.addStep({ | |
type: DIRECT_COMMUNICATION_END_DIRECT_MESSAGES | |
}); | |
} | |
if (step.type === DIRECT_COMMUNICATION_END_DIRECT_MESSAGES) { | |
this.state = undefined; | |
this.when(DIRECT_COMMUNICATION_SHOW_NEXT_MESSAGE); | |
} | |
this.steps.push(step); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment