osrs-tools
Version:
A JavaScript package to provide JSON data for all current Old School RuneScape quests. This package aims to help junior software developers create tools related to Old School RuneScape. It's a work in progress, and issues should be reported to jamescer@ha
86 lines (85 loc) • 3.86 kB
TypeScript
import { Requirement } from "../Requirement";
/**
* Represents a Slayer task in the game. This class encapsulates all the properties and methods related to a Slayer task.
* A Slayer task defines the monsters that players can be assigned to kill, the amount of those monsters, and various other attributes.
* A Task is not an assignment, but rather a template for an assignment.
* The assignment is the actual task given to a player, which is based on the Task.
*/
declare class Task {
name: string;
weight: number;
amountMin: number;
amountMax: number;
requirements: Requirement[];
extendedAmountMin?: number | null;
extendedAmountMax?: number | null;
alternatives?: any[] | null;
CombatLevels: number[];
SlayerExp: number;
locations: string[];
WildernessLevels: number[];
bosses: string[];
/**
* Constructor for the Task class.
* @param name - Name of the task
* @param amountMin - Minimum amount of monsters to kill for this task
* @param amountMax - Maximum amount of monsters to kill for this task
* @param requirements - Array of requirements for this task
* @param extendedAmountMin - Minimum amount for extended tasks (optional)
* @param extendedAmountMax - Maximum amount for extended tasks (optional)
* @param weight - Weight of the task (default is 1)
* @param alternatives - Array of alternatives for this task (optional)
* @param CombatLevels - Array of combat levels for this task
* @param SlayerExp - Slayer experience gained from this task
* @param locations - Array of locations where this task can be found
* @param WildernessLevels - Array of wilderness levels for this task
* @param bosses - Array of bosses for this task
*/
constructor(name: string, amountMin: number, amountMax: number, requirements: Requirement[], extendedAmountMin?: number | null, extendedAmountMax?: number | null, alternatives?: string[], weight?: number, CombatLevels?: number[], SlayerExp?: number, locations?: string[], WildernessLevels?: number[], bosses?: string[]);
static fromJSON(json: any): Task;
/**
* Get the name of the task.
* @example
* const task = new Task("Goblin", 10, 20, [], 0, null, [], 1);
* console.log(task.getName()); // "Goblin"
* @returns
*/
getName(): string;
/**
* Get the weight of the task. The weight is used to determine the likelihood of being assigned this task compared to others.
* @returns {number} The weight of the task, which can be used to determine the likelihood of being assigned this task compared to others.
*/
getWeight(): number;
/**
* Get the minimum and maximum amount of monsters to kill for this task.
* The amountMin and amountMax properties define the range of monsters that can be assigned for this task.
* @returns {number} The minimum amount of monsters to kill for this task.
*/
getAmountMin(): number;
/**
* Get the maximum amount of monsters to kill for this task.
* @returns {number} The maximum amount of monsters to kill for this task.
*/
getAmountMax(): number;
/**
*
*/
getRequirements(): Requirement[];
/**
*
* @returns {any[]} An array of alternatives for this task. If alternatives are defined as an object, it flattens the values into a single array.
*/
getAlternatives(): any[];
/**
*
* @returns
*/
toJSON(): any;
/**
* Returns a string representation of the Task object.
* This method is useful for debugging and logging purposes, providing a quick overview of the task's name and other properties.
* @returns {string} A string representation of the Task object, useful for debugging and logging purposes.
*/
toString(): string;
}
export { Task };