forked from BetonQuest/BetonQuest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/org/betonquest/betonquest/quest/event/stage/StageEvent.java
This file contains 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
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)); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/org/betonquest/betonquest/quest/event/stage/StageEventFactory.java
This file contains 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
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; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/org/betonquest/betonquest/quest/event/stage/package-info.java
This file contains 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
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; |