Skip to content

Commit

Permalink
Deprecate IQuest.getCompletedCount for IQuest.getCompletions
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed May 16, 2024
1 parent 22c0964 commit 18828f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/games/stendhal/server/maps/quests/AbstractQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,16 @@ public boolean isCompleted(final Player player) {
&& player.isQuestCompleted(getSlotName());
}

/**
* Retrieves number of times player has completed quest.
*
* @param player
* Player for whom quest is being checked.
* @return
* Number of completions.
*/
@Override
public int getCompletedCount(final Player player) {
public int getCompletions(final Player player) {
final String questSlot = getSlotName();
final boolean completed = isCompleted(player);
if (player.hasQuest(questSlot)) {
Expand All @@ -167,6 +175,12 @@ public int getCompletedCount(final Player player) {
return completed ? 1 : 0;
}

@Deprecated
@Override
public int getCompletedCount(final Player player) {
return getCompletions(player);
}

/**
* Retrieves action to execute when completions count should be incremented.
*
Expand Down
11 changes: 11 additions & 0 deletions src/games/stendhal/server/maps/quests/IQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ public interface IQuest {
* @return
* Number of completions.
*/
int getCompletions(Player player);

/**
* Retrieves number of times player has completed quest.
*
* @param player
* Player for whom quest is being checked.
* @return
* Number of completions.
*/
@Deprecated
int getCompletedCount(Player player);

/**
Expand Down

0 comments on commit 18828f7

Please sign in to comment.