RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.Waypoints Class Reference

Static Public Member Functions

static void getWaypoints (Player player)
static void removeWaypoint (Player player, String waypointName)
static void setWaypoint (Player player, String waypointName)

Static Private Member Functions

static int getAllowedPoints (Player player)

Detailed Description

Definition at line 7 of file Waypoints.java.

Member Function Documentation

◆ getAllowedPoints()

int com.runehive.content.Waypoints.getAllowedPoints ( Player player)
staticprivate

Definition at line 38 of file Waypoints.java.

38 {
39 return switch (player.right.getName()) {
40 case "King Donator" -> 10;
41 case "Elite Donator" -> 8;
42 case "Extreme Donator" -> 6;
43 case "Super Donator" -> 4;
44 case "Donator" -> 2;
45 default -> 5;
46 };
47 }

References com.runehive.game.world.entity.mob.player.PlayerRight.getName(), and com.runehive.game.world.entity.mob.player.Player.right.

Referenced by setWaypoint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWaypoints()

void com.runehive.content.Waypoints.getWaypoints ( Player player)
static

Definition at line 30 of file Waypoints.java.

30 {
31 if (player.waypoints.isEmpty()) {
32 player.message("You have no waypoints set.");
33 return;
34 }
35 player.message("Current waypoints:");
36 player.waypoints.forEach((k, v) -> player.message("@red@" +k));
37 }

References com.runehive.game.world.entity.mob.player.Player.message(), and com.runehive.game.world.entity.mob.player.Player.waypoints.

Here is the call graph for this function:

◆ removeWaypoint()

void com.runehive.content.Waypoints.removeWaypoint ( Player player,
String waypointName )
static

Definition at line 26 of file Waypoints.java.

26 {
27 player.waypoints.remove(waypointName);
28 player.dialogueFactory.sendStatement("You have removed " + waypointName + " from your waypoints.").execute();
29 }

References com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), and com.runehive.game.world.entity.mob.player.Player.waypoints.

Here is the call graph for this function:

◆ setWaypoint()

void com.runehive.content.Waypoints.setWaypoint ( Player player,
String waypointName )
static

Definition at line 9 of file Waypoints.java.

9 {
10 if(Area.inRestrictedArea(player)) {
11 player.message("You cannot set a waypoint here");
12 return;
13 }
14 if (player.waypoints.size() >= getAllowedPoints(player)) {
15 player.message("You have reached the maximum amount of waypoints allowed for your rank.");
16 return;
17 }
18 if (player.waypoints.containsKey(waypointName)) {
19 player.message("You already have a waypoint with this name.");
20 return;
21 }
22 player.waypoints.put(waypointName, player.getPosition().copy());
23 player.dialogueFactory.sendStatement("You have set a waypoint named " + waypointName + " at your current location.").execute();
24 }

References com.runehive.game.world.position.Position.copy(), com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), getAllowedPoints(), com.runehive.game.world.entity.Entity.getPosition(), com.runehive.game.world.position.Area.inRestrictedArea(), com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), and com.runehive.game.world.entity.mob.player.Player.waypoints.

Here is the call graph for this function:

The documentation for this class was generated from the following file: