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

Handles displaying player's activity log. More...

Collaboration diagram for com.runehive.content.ActivityLogger:

Public Member Functions

 ActivityLogger (Player player)
void add (ActivityLog log)
void add (ActivityLog log, int amount)
int get (ActivityLog log)
void open ()

Private Attributes

final Player player

Detailed Description

Handles displaying player's activity log.

Author
Daniel

Definition at line 14 of file ActivityLogger.java.

Constructor & Destructor Documentation

◆ ActivityLogger()

com.runehive.content.ActivityLogger.ActivityLogger ( Player player)

Definition at line 17 of file ActivityLogger.java.

17 {
18 this.player = player;
19 }

References player.

Member Function Documentation

◆ add() [1/2]

void com.runehive.content.ActivityLogger.add ( ActivityLog log)

Definition at line 21 of file ActivityLogger.java.

21 {
22 add(log, 1);
23 }

References add().

Referenced by add(), com.runehive.content.activity.impl.barrows.BarrowsUtility.generateRewards(), and com.runehive.game.world.entity.mob.npc.NpcDeath.postDeath().

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

◆ add() [2/2]

void com.runehive.content.ActivityLogger.add ( ActivityLog log,
int amount )

Definition at line 25 of file ActivityLogger.java.

25 {
26 int current = player.loggedActivities.computeIfAbsent(log, a -> 0);
27 player.loggedActivities.put(log, current + amount);
28 player.message("Your " + Utility.formatEnum(log.name()) + " count is now <col=FF0000>" + get(log) + "</col>.");
29 }

References com.runehive.util.Utility.formatEnum(), and player.

Here is the call graph for this function:

◆ get()

int com.runehive.content.ActivityLogger.get ( ActivityLog log)

Definition at line 31 of file ActivityLogger.java.

31 {
32 if (!player.loggedActivities.containsKey(log)) {
33 player.loggedActivities.put(log, 0);
34 }
35 return player.loggedActivities.get(log);
36 }

References player.

◆ open()

void com.runehive.content.ActivityLogger.open ( )

Definition at line 38 of file ActivityLogger.java.

38 {
39 for (int index = 0, string = 37111; index < 80; index++) {
40 player.send(new SendString("", string));
41 string++;
42 player.send(new SendString("", string));
43 string++;
44 }
45
46 int string = 37111;
47 for (ActivityLog log : ActivityLog.values()) {
48 player.send(new SendString(Utility.formatEnum(log.name()) + ": <col=255>" + Utility.formatDigits(get(log)), string));
49 string++;
50 }
51
52 player.send(new SendString("", 37107));
53 player.send(new SendString("Activity Logger", 37103));
54 player.send(new SendScrollbar(37110, (player.loggedActivities.size() * 55)));
55 player.interfaceManager.open(37100);
56 }
val index

References com.runehive.util.Utility.formatDigits(), com.runehive.util.Utility.formatEnum(), and player.

Referenced by com.runehive.game.plugin.PluginContext.onClick().

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

Member Data Documentation

◆ player

final Player com.runehive.content.ActivityLogger.player
private

Definition at line 15 of file ActivityLogger.java.

Referenced by ActivityLogger(), add(), get(), and open().


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