Skip to content

Commit

Permalink
added Stage Event
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf2323 committed Nov 3, 2023
1 parent 6406207 commit 787a107
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.betonquest.betonquest.quest.event.stage;

import org.betonquest.betonquest.VariableString;
import org.betonquest.betonquest.api.profiles.Profile;
import org.betonquest.betonquest.api.quest.event.Event;
import org.betonquest.betonquest.exceptions.QuestRuntimeException;
import org.betonquest.betonquest.objectives.StageObjective;

/**
* The StageEvent class to set the players stage.
*/
public class StageEvent implements Event {
/**
* The stage objective.
*/
private final StageObjective stage;

/**
* The target stage to set.
*/
private final VariableString targetStage;

/**
* Creates the stage event.
*
* @param stage the stage objective.
* @param targetStage the target stage to set.
*/
public StageEvent(final StageObjective stage, final VariableString targetStage) {
this.stage = stage;
this.targetStage = targetStage;
}

@Override
public void execute(final Profile profile) throws QuestRuntimeException {
stage.setStage(profile, targetStage.getString(profile));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.betonquest.betonquest.quest.event.stage;

import org.betonquest.betonquest.Instruction;
import org.betonquest.betonquest.api.quest.event.Event;
import org.betonquest.betonquest.api.quest.event.EventFactory;
import org.betonquest.betonquest.exceptions.InstructionParseException;

public class StageEventFactory implements EventFactory {
@Override
public Event parseEvent(final Instruction instruction) throws InstructionParseException {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* {@link org.betonquest.betonquest.api.quest.event.Event Event} implementation of the stage event.
*/
package org.betonquest.betonquest.quest.event.stage;

0 comments on commit 787a107

Please sign in to comment.