Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.github.manolo8.darkbot.core.itf.Updatable;
import com.github.manolo8.darkbot.core.objects.facades.AssemblyMediator;
import com.github.manolo8.darkbot.core.objects.facades.AstralGateProxy;
import com.github.manolo8.darkbot.core.objects.facades.BonusCalendarProxy;
import com.github.manolo8.darkbot.core.objects.facades.BoosterProxy;
import com.github.manolo8.darkbot.core.objects.facades.ChatProxy;
import com.github.manolo8.darkbot.core.objects.facades.ChrominProxy;
Expand All @@ -22,8 +23,8 @@
import com.github.manolo8.darkbot.core.objects.facades.InventoryProxy;
import com.github.manolo8.darkbot.core.objects.facades.LogMediator;
import com.github.manolo8.darkbot.core.objects.facades.NpcEventProxy;
import com.github.manolo8.darkbot.core.objects.facades.SeassonPassMediator;
import com.github.manolo8.darkbot.core.objects.facades.QuestProxy;
import com.github.manolo8.darkbot.core.objects.facades.SeassonPassMediator;
import com.github.manolo8.darkbot.core.objects.facades.SettingsProxy;
import com.github.manolo8.darkbot.core.objects.facades.SlotBarsProxy;
import com.github.manolo8.darkbot.core.objects.facades.SpaceMapWindowProxy;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class FacadeManager implements Manager, eu.darkbot.api.API.Singleton, Npc
public final WorldBossOverviewProxy worldBossOverview;
public final Updatable group;
public final Updatable groupMediator;
public final BonusCalendarProxy bonusCalendarProxy;

private final Map<EventType, NpcEventProxy> npcEvents = new HashMap<>();

Expand All @@ -88,6 +90,7 @@ public FacadeManager(PluginAPI pluginApi) {
this.worldBossOverview = registerProxy("worldBoss_overview", WorldBossOverviewProxy.class);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI] Minor: Inconsistent indentation/spacing around the new line. his.groupMediator has extra whitespace compared to other fields. Consider keeping consistent formatting with existing code style.

this.group = registerProxy("GroupProxy", Updatable.NoOp.class);
this.groupMediator = registerMediator("GroupSystemMediator", Updatable.NoOp.class);
this.bonusCalendarProxy = registerProxy("miniclient_reward", BonusCalendarProxy.class);

registerProxy("dispatch", DispatchProxy.class);
registerProxy("dispatch_retriever", DispatchRetrieverProxy.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class GuiManager implements Manager, GameScreenAPI {
public final GroupManager group;
public final SettingsGui settingsGui;
public final ChatGui chat;
public final Gui bonusCalendar;

public final Gui assembly;

Expand Down Expand Up @@ -148,6 +149,7 @@ public GuiManager(Main main, PluginAPI pluginAPI, RepairManager repairManager) {
this.refinement = register("refinement", RefinementGui.class);
this.chat = register("chat", ChatGui.class);
this.settingsGui = register("settings", SettingsGui.class);
this.bonusCalendar = register("miniclient_reward");

register("dispatch", DispatchManager.class);
register("dispatch_popup_reward_list", DispatchPopupRewardGui.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.manolo8.darkbot.core.objects.facades;

import com.github.manolo8.darkbot.core.itf.Updatable;
import com.github.manolo8.darkbot.core.objects.swf.FlashList;
import eu.darkbot.api.managers.BonusCalendarAPI;
import lombok.Getter;
import lombok.ToString;

@Getter
public class BonusCalendarProxy extends Updatable implements BonusCalendarAPI {
private int daysClaimed;
private boolean claimable;
private final FlashList<RewardLoot> rewardList = FlashList.ofVector(RewardLoot::new);

@Override
public void update() {
daysClaimed = readInt(0x30, 0x40);
rewardList.update(readAtom(0x30, 0x58));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the listing does not change, this will only be read once

claimable = readBoolean(0x30, 0x50, 0x20);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI] Consider using BonusCalendarAPI.ClaimState instead of primitive �oolean for better extensibility if more claim states are added in the future (e.g., ALREADY_CLAIMED, LOCKED, etc.). This would align with the API interface pattern.

}

@Getter
@ToString
private static class RewardLoot extends Updatable implements BonusCalendarAPI.RewardList {
private String lootId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[AI] The inner RewardLoot class is marked private. If extensibility or testing is needed, consider making it package-private or protected. Currently private is fine for encapsulation if no external access is required.

private int amount;

@Override
public void update() {
Comment thread
anjeshshrestha marked this conversation as resolved.
this.amount = readInt(0x20);
this.lootId = readString(0x30);
}
}
}
Loading