Skip to content

Commit

Permalink
hide constructors of Builders
Browse files Browse the repository at this point in the history
  • Loading branch information
nhnb committed Sep 16, 2023
1 parent de18fd0 commit 4953c23
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/games/stendhal/server/entity/npc/quest/BringItemTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class BringItemTask extends QuestTaskBuilder {
private Pair<String, Integer> requestItem;
private List<Pair<String, Integer>> alternativeItems = new LinkedList<>();

// hide constructor
BringItemTask() {
super();
}

/**
* request an item from the player
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ String getRespondToSlowDelivery() {
return respondToSlowDelivery;
}

// hide constructor
DeliverItemOrder() {
super();
}

public DeliverItemOrder customerNpc(String npc) {
deliverItemTask.getOrders().remove(this.npc);
this.npc = npc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public class DeliverItemQuestHistoryBuilder extends QuestHistoryBuilder {
private String whenInTime;
private String whenOutOfTime;

// hide constructor
DeliverItemQuestHistoryBuilder() {
super();
}

@Override
public DeliverItemQuestHistoryBuilder whenNpcWasMet(String whenNpcWasMet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

public class DeliverItemQuestOfferBuilder extends QuestOfferBuilder<DeliverItemQuestOfferBuilder> {

// hide constructor
DeliverItemQuestOfferBuilder() {
super();
}

}
19 changes: 19 additions & 0 deletions src/games/stendhal/server/entity/npc/quest/DeliverItemTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,31 @@


public class DeliverItemTask extends QuestTaskBuilder {

private final static Outfit UNIFORM = new Outfit(null, Integer.valueOf(990), null, null, null, null, null, null, null);

private static final String QUEST_SLOT = "pizza_delivery";

private Outfit outfit;
private String itemDescription;
private String itemName;
/*
private final static Outfit UNIFORM = new Outfit(null, Integer.valueOf(990), null, null, null, null, null, null, null);
pizza.setDescription(StringUtils.substitute("You see a [flavor].", params));
npc.say(StringUtils.substitute("You must bring this [flavor] to [customerName] within [time]. Say \"pizza\" so that [customerName] knows that I sent you. Oh, and please wear this uniform on your way.", params));
npc.say("Come back when you have space to carry the pizza!");
putOffUniform(player);
npc.say(StringUtils.substitute("I see you failed to deliver the pizza to [customerName] in time. Are you sure you will be more reliable this time?", params));
npc.say(StringUtils.substitute("You still have to deliver a pizza to [customerName], and hurry!", params));
}
*/

private Map<String, DeliverItemOrder> orders = new HashMap<>();

// hide constructor
DeliverItemTask() {
super();
}

/**
* Get a list of customers appropriate for a player
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
public class KillCreaturesTask extends QuestTaskBuilder {
private HashMap<String, Pair<Integer, Integer>> requestKill = new HashMap<>();

// hide constructor
KillCreaturesTask() {
super();
}

/**
* request killing creatures
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
*/
public abstract class QuestCompleteBuilder {

// hide constructor
QuestCompleteBuilder() {
super();
}

abstract void simulate(String npc, QuestSimulator simulator);

abstract void build(SpeakerNPC npc, String questSlot, ChatCondition questCompletedCondition, ChatAction questCompleteAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class QuestHistoryBuilder {
private String whenQuestCanBeRepeated;
private String whenCompletionsShown;

// hide constructor
QuestHistoryBuilder() {
super();
}

public QuestHistoryBuilder whenNpcWasMet(String whenNpcWasMet) {
this.whenNpcWasMet = whenNpcWasMet;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public class QuestInfoBuilder {
private String region = "somewhere";
private String questGiverNpc = null;

// hide constructor
QuestInfoBuilder() {
super();
}

public QuestInfoBuilder name(String name) {
this.name = name;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public class QuestOfferBuilder<T extends QuestOfferBuilder<T>> {
private List<String> lastRespondTo = null;
private Map<List<String>, String> additionalReplies = new HashMap<>();

// hide constructor
QuestOfferBuilder() {
super();
}

@SuppressWarnings("unchecked")
public T respondToFailedPreCondition(String respondToFailedPreCondition) {
this.respondToFailedPreCondition = respondToFailedPreCondition;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
*/
public abstract class QuestTaskBuilder {

// hide constructor
QuestTaskBuilder() {
super();
}

abstract void simulate(QuestSimulator simulator);

ChatCondition buildQuestPreCondition(@SuppressWarnings("unused") String questSlot) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public class SimpleQuestCompleteBuilder extends QuestCompleteBuilder {
private String respondToAccept = null;
private List<ChatAction> rewardWith = new LinkedList<>();

// hide constructor
SimpleQuestCompleteBuilder() {
super();
}

public SimpleQuestCompleteBuilder greet(String greet) {
this.greet = greet;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
/***************************************************************************
* (C) Copyright 2023-2023 - Stendhal *
***************************************************************************
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
package games.stendhal.server.entity.npc.quest;

public class SimpleQuestOfferBuilder extends QuestOfferBuilder<SimpleQuestOfferBuilder> {

// hide constructor
SimpleQuestOfferBuilder() {
super();
}
}

0 comments on commit 4953c23

Please sign in to comment.