Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/guides/GuideTour.java

97 lines
2.9 KiB
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.guides;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.users.Habbo;
import gnu.trove.set.hash.THashSet;
2019-05-26 20:14:53 +02:00
public class GuideTour {
private final Habbo noob;
private final String helpRequest;
private final THashSet<GuideChatMessage> sendMessages = new THashSet<>();
private final THashSet<Integer> declinedHelpers = new THashSet<>();
2018-07-06 15:30:00 +02:00
public int checkSum = 0;
private Habbo helper;
private int startTime;
private int endTime;
private boolean ended;
private GuideRecommendStatus wouldRecommend = GuideRecommendStatus.UNKNOWN;
2019-05-26 20:14:53 +02:00
public GuideTour(Habbo noob, String helpRequest) {
2018-07-06 15:30:00 +02:00
this.noob = noob;
this.helpRequest = helpRequest;
AchievementManager.progressAchievement(this.noob, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GuideAdvertisementReader"));
}
2019-05-26 20:14:53 +02:00
public void finish() {
2018-07-06 15:30:00 +02:00
//TODO Insert recommendation.
//TODO Query messages.
}
2019-05-26 20:14:53 +02:00
public Habbo getNoob() {
2018-07-06 15:30:00 +02:00
return this.noob;
}
2019-05-26 20:14:53 +02:00
public String getHelpRequest() {
2018-07-06 15:30:00 +02:00
return this.helpRequest;
}
2019-05-26 20:14:53 +02:00
public Habbo getHelper() {
2018-07-06 15:30:00 +02:00
return this.helper;
}
2019-05-26 20:14:53 +02:00
public void setHelper(Habbo helper) {
2018-07-06 15:30:00 +02:00
this.helper = helper;
}
2019-05-26 20:14:53 +02:00
public void addMessage(GuideChatMessage message) {
2018-07-06 15:30:00 +02:00
this.sendMessages.add(message);
}
2019-05-26 20:14:53 +02:00
public GuideRecommendStatus getWouldRecommend() {
2018-07-06 15:30:00 +02:00
return this.wouldRecommend;
}
2019-05-26 20:14:53 +02:00
public void setWouldRecommend(GuideRecommendStatus wouldRecommend) {
2018-07-06 15:30:00 +02:00
this.wouldRecommend = wouldRecommend;
2019-05-26 20:14:53 +02:00
if (this.wouldRecommend == GuideRecommendStatus.YES) {
2018-07-06 15:30:00 +02:00
AchievementManager.progressAchievement(this.getHelper(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("GuideRecommendation"));
}
}
2019-05-26 20:14:53 +02:00
public void addDeclinedHelper(int userId) {
2018-07-06 15:30:00 +02:00
this.declinedHelpers.add(userId);
}
2019-05-26 20:14:53 +02:00
public boolean hasDeclined(int userId) {
2018-07-06 15:30:00 +02:00
return this.declinedHelpers.contains(userId);
}
2019-05-26 20:14:53 +02:00
public void end() {
2018-07-06 15:30:00 +02:00
this.ended = true;
this.endTime = Emulator.getIntUnixTimestamp();
AchievementManager.progressAchievement(this.helper, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GuideEnrollmentLifetime"));
AchievementManager.progressAchievement(this.helper, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GuideRequestHandler"));
AchievementManager.progressAchievement(this.noob, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GuideRequester"));
}
2019-05-26 20:14:53 +02:00
public boolean isEnded() {
2018-07-06 15:30:00 +02:00
return this.ended;
}
2019-05-26 20:14:53 +02:00
public int getStartTime() {
2018-07-06 15:30:00 +02:00
return this.startTime;
}
2019-05-26 20:14:53 +02:00
public void setStartTime(int startTime) {
2018-07-06 15:30:00 +02:00
this.startTime = startTime;
}
2019-05-26 20:14:53 +02:00
public int getEndTime() {
2018-07-06 15:30:00 +02:00
return this.endTime;
}
}