-
Notifications
You must be signed in to change notification settings - Fork 67
add bonus calendar proxy #381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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() { | ||
|
anjeshshrestha marked this conversation as resolved.
|
||
| this.amount = readInt(0x20); | ||
| this.lootId = readString(0x30); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
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.