Skip to content

Commit

Permalink
tiny code polish
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed Nov 16, 2024
1 parent a40a9e1 commit ee9f88f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.questhelper.QuestHelperPlugin;
import com.questhelper.requirements.ManualRequirement;
import com.questhelper.requirements.Requirement;
import com.questhelper.requirements.item.ItemRequirement;
import com.questhelper.requirements.widget.WidgetModelRequirement;
import com.questhelper.requirements.widget.WidgetPresenceRequirement;
Expand All @@ -14,7 +13,6 @@
import com.questhelper.steps.ObjectStep;
import com.questhelper.steps.QuestStep;
import java.awt.*;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@
import com.questhelper.questinfo.QuestHelperQuest;
import com.questhelper.requirements.Requirement;
import com.questhelper.requirements.item.ItemRequirement;
import com.questhelper.requirements.item.ItemRequirements;
import com.questhelper.requirements.item.TeleportItemRequirement;
import com.questhelper.requirements.player.CombatLevelRequirement;
import com.questhelper.requirements.player.FreeInventorySlotRequirement;
import com.questhelper.requirements.player.SkillRequirement;
import com.questhelper.requirements.quest.QuestRequirement;
import static com.questhelper.requirements.util.LogicHelper.and;
import static com.questhelper.requirements.util.LogicHelper.nor;
import static com.questhelper.requirements.util.LogicHelper.not;
import static com.questhelper.requirements.util.LogicHelper.or;
import com.questhelper.requirements.util.Operation;
import com.questhelper.requirements.var.VarbitRequirement;
import com.questhelper.requirements.zone.Zone;
import com.questhelper.requirements.zone.ZoneRequirement;
Expand Down Expand Up @@ -582,7 +579,6 @@ public void setupSteps()

var inSecondPart = new ZoneRequirement(new Zone(new WorldPoint(3590, 4538, 0), new WorldPoint(3622, 4597, 0)));
var inStorageRoom = new ZoneRequirement(new Zone(new WorldPoint(3614, 4571, 0), new WorldPoint(3605, 4563, 0)));
var decoderStrips = new ItemRequirement("Decoder strips", ItemID.DECODER_STRIPS);
searchTableForDecoderStrips = new ObjectStep(this, ObjectID.TABLE_50533, "Search the table for some decoder strips.");
enterStorageRoom = new ObjectStep(this, ObjectID.GATE_50537, new WorldPoint(3609, 4572, 0), "Enter the storage room to the south-east.");
var exitStorageRoom = new ObjectStep(this, ObjectID.GATE_50537, new WorldPoint(3609, 4572, 0), "Exit the storage room.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,6 @@ public void onGameTick(GameTick event)
this.shortestPath = possiblePath;
}
}

if (this.shortestPath == null)
{
// TODO: tell user to just find a way to solve it lol
}
else
{
// TODO: figure out how to highlight this? make object steps?
// How do I get the correct world points? maybe check objectstep to see if we offset it somewhere with instance points or something
}
}

updateSteps();
Expand Down Expand Up @@ -359,7 +349,6 @@ protected void updateSteps()
{
log.debug("user stepped off the path, lead them back");
startUpStep(this.mostRecentStep);
return;
}
} else {
log.debug("player is outside of puzzle: {} / {} / {}/{}", playerWp, localPoint, xInPuzzle, yInPuzzle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ public abstract class RubbleSolver extends DetailedOwnerStep {
private List<Requirement> inverseConditions;
private ConditionalStep conditionalStep;

private int stepCounter;
@SuppressWarnings({"unused", "FieldCanBeLocal"})
private int stepCounter;

public RubbleSolver(TheCurseOfArrav theCurseOfArrav, String number) {
public RubbleSolver(TheCurseOfArrav theCurseOfArrav, @SuppressWarnings("unused") String number) {
super(theCurseOfArrav, "Make your way through the Trollweiss cave, mining rubble with your pickaxe from the direction indicated. Rubble can only be mined from the same direction once.");
}

Expand Down Expand Up @@ -115,9 +116,6 @@ protected void setupSteps() {
// Useful for debugging
// mineStep.addRequirement(inverseCondition);

// var xd = new Conditions(LogicType.AND, inverseCondition);
// xd.setText(inverseCondition.getDisplayText());

conditionalStep.addStep(inverseCondition, mineStep);
}
}
Expand All @@ -131,9 +129,7 @@ public List<QuestStep> getSteps() {
var steps = new ArrayList<QuestStep>();

steps.add(this.conditionalStep);
for (var step : this.mineSteps) {
steps.add(step);
}
steps.addAll(this.mineSteps);

return steps;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
package com.questhelper.helpers.quests.thecurseofarrav.rubblesolvers;

import com.questhelper.helpers.quests.thecurseofarrav.TheCurseOfArrav;
import com.questhelper.requirements.Requirement;
import com.questhelper.requirements.conditional.Conditions;
import com.questhelper.requirements.conditional.ObjectCondition;
import com.questhelper.requirements.util.LogicType;
import com.questhelper.steps.*;

import java.util.*;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.*;
import net.runelite.api.coords.Direction;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.GameTick;
import net.runelite.client.eventbus.Subscribe;

/**
* This class describes the rubble mining steps required for Roadblock 1 (when quest state varbit is 22)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.Getter;
import net.runelite.api.ObjectID;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Getter
Expand All @@ -15,10 +16,7 @@ public enum RubbleType
private final List<Integer> objectIDs;

RubbleType(Integer... possibleObjectIDs) {
this.objectIDs = new ArrayList<Integer>();
for (var xd : possibleObjectIDs) {
this.objectIDs.add(xd);
}
// Collections.addAll(this.objectIDs, possibleObjectIDs);
this.objectIDs = new ArrayList<>();
Collections.addAll(this.objectIDs, possibleObjectIDs);
}
}

0 comments on commit ee9f88f

Please sign in to comment.